Hello, my company is evaluating Spire.PDF for Java and i’m testing the signatures functions. With the code below:
String filePathString = "mycert.pfx";
PdfCertificate cert = PdfCertificate(filePathString,"mypassword");
I have the error:
Exception in thread "main" com.spire.pdf.packages.sprbwu: Undefined length encoding.
at com.spire.pdf.packages.sprqpq.<init>(ASN1.java:52)
at com.spire.pdf.packages.spryuq.spr?(PKCS12.java:284)
at com.spire.pdf.packages.spryuq.<init>(PKCS12.java:273)
at com.spire.pdf.interactive.digitalsignatures.PdfCertificate.spr??(Unknown Source)
at com.spire.pdf.interactive.digitalsignatures.PdfCertificate.<init>(Unknown Source)
at spirepdfant.Spirepdfant.main(Spirepdfant.java:95)
I’m using Spire.Pdf.jar version 11.10.3 and a JDK 24 64 bit.
Obviously the problem is in my certificate since the ‘gary.pfx’ certificate i found in your samples is working well.
The same code with Spire.PDF for .NET (v. 11.11.1) and .NET Framework 4.6 is working.
My certificate is a regular certificate given to me from an italian government entity with my name inside and so on.
Can you help me?