PdfSignatureContent Class
Represents the content of the PdfSignature.
For public-key signatures, PdfSignatureContent should be either a DER-encoded PKCS#1 binary data object (octet string) or a DER-encoded CMS binary data object.
For document timestamp signatures, PdfSignatureContent shall be the TimeStampToken as specified in RFC 3161 as updated by RFC 5816. The value of the messageImprint field within the TimeStampToken shall be a hash of the bytes of the document indicated by the ByteRange and the ByteRange shall specify the complete PDF file contents (excepting the Content value).
- Inheritance:
- System.ObjectPdfSignatureContent
Properties
HashAlgorithm
Gets the hash algorithm used to hash the contents of a PDF file upon which the signature's Value is computed by PdfDigitalId.
public PdfHashAlgorithm HashAlgorithm { get; }
Public ReadOnly Property HashAlgorithm As PdfHashAlgorithm
Property Value
The hash algorithm used to hash the contents of a PDF file upon which the signature's Value is computed by PdfDigitalId.
PolicyIdentifier
Gets the signature policy identifier contained in the PdfSignatureContent or null if signature doesn't contain a policy identifier.
public PdfSignaturePolicyIdentifier PolicyIdentifier { get; }
Public ReadOnly Property PolicyIdentifier As PdfSignaturePolicyIdentifier
Property Value
The signature policy identifier contained in the PdfSignatureContent or null if signature doesn't contain a policy identifier.
RSASignaturePadding
Gets the RSA signature padding used if signer's certificate has an 'RSA' public key.
public PdfRSASignaturePadding RSASignaturePadding { get; }
Public ReadOnly Property RSASignaturePadding As PdfRSASignaturePadding
Property Value
The RSA signature padding used if signer's certificate has an 'RSA' public key.
SignerCertificate
Gets the signer certificate contained in the PdfSignatureContent.
public PdfCertificate SignerCertificate { get; }
Public ReadOnly Property SignerCertificate As PdfCertificate
Property Value
The signer certificate contained in the PdfSignatureContent.
TimestampToken
Gets the timestamp token contained in the PdfSignatureContent or null if signature doesn't contain a timestamp.
public PdfSignatureContent TimestampToken { get; }
Public ReadOnly Property TimestampToken As PdfSignatureContent
Property Value
The timestamp token contained in the PdfSignatureContent or null if signature doesn't contain a timestamp.
ValidationInfo
Gets the (potentially partial) validation-related information (certificates, certificate revocation lists and Online Certificate Status Protocol responses) contained in the PdfSignatureContent.
public PdfSignatureValidationInfo ValidationInfo { get; }
Public ReadOnly Property ValidationInfo As PdfSignatureValidationInfo
Property Value
The (potentially partial) validation-related information (certificates, certificate revocation lists and Online Certificate Status Protocol responses) contained in the PdfSignatureContent.
Value
Gets the signature value.
Property Value
- System.Byte[]
The signature value.
Methods
GetHash(out PdfHashAlgorithm)
Gets the hash over which the signature was computed, if the hash is contained in the PdfSignatureContent; otherwise, null.
If the PdfSignatureContent is a DER-encoded PKCS#1 binary data object (octet string) and conforms to PKCS#1 standard, the hash is null because it not contained in the signature and hashAlgorithm
is Unknown.
If the PdfSignatureContent is a DER-encoded CMS binary data object and conforms to RFC 5652 Cryptographic Message Syntax, the hash is either the value of the encapContentInfo field within the SignedData (if eContent field within the EncapsulatedContentInfo is not empty, in which case hashAlgorithm
is GemBox.Pdf.Security.PdfHashAlgorithm.SHA1 because the PdfSignatureContent is in the GemBox.Pdf.Forms.PdfSignatureFormat.PKCS7_SHA1 format) or the value of the MessageDigest signed attribute (if present).
If the PdfSignatureContent is a TimeStampToken as specified in RFC 3161 as updated by RFC 5816, the hash is the value of the messageImprint field within the TimeStampToken.
public byte[] GetHash(out PdfHashAlgorithm hashAlgorithm)
Public Function GetHash(ByRef hashAlgorithm As PdfHashAlgorithm) As Byte()
Parameters
hashAlgorithm
- PdfHashAlgorithm
The hash algorithm that was used to compute the returned hash.
Returns
- System.Byte[]
The hash over which the signature was computed, if the hash is contained in the PdfSignatureContent; otherwise, null.
GetRawData()
Gets the copy of raw data of a PdfSignatureContent.
Returns
- System.Byte[]
The copy of raw data of the PdfSignatureContent as a byte array.
ToString()
Returns a System.String that represents this PdfSignatureContent instance.
Returns
- System.String
A System.String that represents this PdfSignatureContent instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).