Pdf |
Initiate signing of a PDF file with a digital ID from the specified source.
The digital ID source is either an instance of a X509Certificate2 with a private key or an instance of a CspParameters.
The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is PKCS7 and the ContentsLength is set to the internally estimated size.
To finish the signing, call any of the Save. Next signing cannot be initiated before the current one is not finished.
The returned PdfSignature is set to the Value thus automatically updating the Appearance.
If your project doesn't target Windows platform, to use this method, make sure your project references NuGet package System.Security.Cryptography.Pkcs.
Exception | Condition |
---|---|
ArgumentException | The digitalIdSource parameter is not an instance of a X509Certificate2 or a CspParameters. |
InvalidOperationException | This PdfSignatureField is not contained in the Fields of this PDF document. -or- Signing/timestamping of the PDF file has already been initiated on some PdfSignatureField in this PDF document. Finish that signing/timestamping by calling any of the Save before initiating a new signing/timestamping on this PdfSignatureField. |