Quantcast
Viewing all articles
Browse latest Browse all 3131

Issue with PDFSignature.verifySignature method for Aspose pdf for Java

Hi,

I am trying to verify that a pdf is signed with the correct signature using Aspose 9.3.0. I am using the following code but the verifySignature does not works.

PdfFileSignature pdfSign = new PdfFileSignature();
        pdfSign.bindPdf(fileName);

        boolean isSignatureOk = false;

        if(pdfSign.isContainSignature()) {
            for(Object sn : pdfSign.getSignNames()) {
                String sv = (String) sn;
                String signerName = pdfSign.getSignerName(sv);
                System.out.println("Signer Name = " + signerName);
               
                if(pdfSign.verifySignature(sv)) {
//perform some code
}else{
System.out.println("Signature: "+sv+" invalid");
}

The verifySignature always goes to the else statement saying it is invalid. The same method works fine with PDF kit for Java. Is there any issue in the current version of Aspose.If there is any workaround, can you please help me with that.

Thanks
Rajeev

Viewing all articles
Browse latest Browse all 3131

Trending Articles