Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

The signature byte range is invalid

Last post 07-05-2009, 4:03 AM by aspose.notifier. 4 replies.
Sort Posts: Previous Next
  •  06-30-2009, 8:49 AM 186095

    The signature byte range is invalid .NET

    I'm using the evaluation version to test signing a PDF.  I've created the PFX from the example below.

    http://blogs.msdn.com/maximelamure/archive/2007/01/24/create-your-own-pfx-file-for-clickonce.aspx

    I then followed the example code (see below) in the help file to sign the PDF. When I open the PDF the image has a big red "X" and says "Invalid Signature".  It I look at the signature details i get this i get this:

    Error during signature verification. 

    Unexpected byte range values defining scope of signed data.
    Details: The signature byte range is invalid

    Any insights into what I'm doing wrong?

    string inFile=TestPath + "example1.pdf";

    string outFile=TestPath + "signature.pdf";

     

    //create a new certificate from the certificate file

    Certificate cert=new Certificate(TestPath+"allen.pfx","psw");

     

    //pass certificate to the PdfFileSignature object

    PdfFileSignature pdfSign=new PdfFileSignature(cert);

    pdfSign.BindPdf(inFile);

     

    System.Drawing.Rectangle rect=new System.Drawing.Rectangle(100,100, 200, 100);

     

    //Set signature attributes

    pdfSign.SignModel = PdfFileSignature.WINDOWCERTIFICATE;

    pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";

    pdfSign.CertificationLevel = PdfFileSignature.NOT_CERTIFIED;

     

    //sign and save file

    pdfSign.Sign(2,"Allen","success","ChangSha",true,rect);

    pdfSign.Save(outFile);

    Filed under: PDF;Sigining;Signature
     
  •  07-01-2009, 7:22 AM 186363 in reply to 186095

    Re: The signature byte range is invalid

    I've tried various options for SignModel and CertificateLevel, but still getting the same error.  Any help would be appreciated
     
  •  07-01-2009, 8:18 AM 186381 in reply to 186363

    Re: The signature byte range is invalid

    Hi Larry,

    Sorry for the late reply.

    We're looking into the matter. Please spare us some time so we could investigate the issue at our end. We'll update you the earliest possible.

    We're sorry for the inconvenience.

    Regards,

     


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  07-01-2009, 12:18 PM 186444 in reply to 186381

    Re: The signature byte range is invalid

    Hi Larry,

    I have reproduced and logged this issue as PDFKITNET-9529 in our issue tracking system. Our team will be looking into the matter and you'll be updated accordingly.

    We appreciate your patience.

    Regards,

     


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  07-05-2009, 4:03 AM 186913 in reply to 186095

    Re: The signature byte range is invalid

    The issues you have found earlier (filed as 9529) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
     
View as RSS news feed in XML