Error signing an already signed PDF
Hi,
I'm successfully signing a PDF using the Syncfusion control.
But, when I try to add another valid signature, I got error 0x80070057 = the document may contain at most one author signature.
I'm following the code described at https://help.syncfusion.com/file-formats/pdf/working-with-digitalsignature?cs-save-lang=1&cs-lang=vb#signing-an-existing-document
The first signature has the following propterties:
signature.TimeStampServer = New TimeStampServer(New Uri("http://rfc3161timestamp.globalsign.com/advanced"))
signature.EnableValidationAppearance = False
signature.EnableLtv = True
signature.Certificated = True
signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill
The document is loaded as follows:
Dim signature As PdfSignature = Nothing
Try
Dim CampoDeAssinatura As PdfLoadedSignatureField = TryCast(loadedDocument.Form.Fields(0), PdfLoadedSignatureField)
signature = New PdfSignature(loadedDocument, page, pdfCert, "SignatureField", CampoDeAssinatura)
Catch ex As Exception
signature = New PdfSignature(loadedDocument, page, pdfCert, "SignatureField")
End Try
Everything runs OK until the "Save" command, which raises the above error.
The document being signed is the same of the first signature, I mean, I'm signing it normally and trying to resign with another certificate (and all certificates are 100%).
Do you know what is happening here?
I appreciate any help
SIGN IN To post a reply.
4 Replies
DA
DavidBS
August 31, 2019 02:52 AM UTC
Hmmm...
I got the problem and I guess it can be a bug:
If the document is virgin (not signed before) I set "signature.Certified = true" and in opposite (the document is already signed) I set "signature.Certified = false" - and at this point the error raises.
I mean, we cannot set "Certified=false" in an already signed document - we need only to discard the property entirelly.
Ok, some people may consider that setting "Certified=false" is uneccessary anyway since it is the default, but I see as a little bug within the code.
I hope have helped anyone with the same behaviour.
SK
Surya Kumar
Syncfusion Team
September 2, 2019 10:40 AM UTC
Hi David,
Greetings from Syncfusion.
|
Response |
Query |
|
But, when I try to add another valid signature, I got error 0x80070057 = the document may contain at most one author signature.
I'm following the code described at https://help.syncfusion.com/file-formats/pdf/working-with-digitalsignature?cs-save-lang=1&cs-lang=vb#signing-an-existing-document
The first signature has the following propterties:
signature.TimeStampServer = New TimeStampServer(New Uri("http://rfc3161timestamp.globalsign.com/advanced"))
signature.EnableValidationAppearance = False
signature.EnableLtv = True
signature.Certificated = True
signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill
Everything runs OK until the "Save" command, which raises the above error. |
Could you please provide us the stack trace of the exception or error you got along with the PDF in which the error occurs so that we can analyze and provide you exact solution. |
|
If the document is virgin (not signed before) I set "signature.Certified = true" and in opposite (the document is already signed) I set "signature.Certified = false" - and at this point the error raises.
I mean, we cannot set "Certified=false" in an already signed document - we need only to discard the property entirelly.
|
We are analyzing this behavior we will let you know more about this on 04-Sep-19. |
Regards,
Surya Kumar
SL
Sowmiya Loganathan
Syncfusion Team
September 4, 2019 01:10 PM UTC
Hi David,
Please note that the property “Signature.Certified” can be set only when the signature is field is created and added to the PDF. Modifying the existing signature in PDF will invalidate the signature present in the PDF.
So could you please provide us your exact requirement for changing the “Signature.Certified= false” in already signed PDF document, so that we can help you with better solution on the same.
Regards,
Sowmiya L
DA
DavidBS
September 4, 2019 01:45 PM UTC
Thank YOU Sowmyia, yes, you're right but to avoid too much text, let's interact on that:
I appreciate your time, help and efforts.
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
DA DavidBS
- Aug 31, 2019 02:34 AM UTC
- Sep 4, 2019 01:45 PM UTC