GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfSignatureContent Class

    Namespace:
    GemBox.Pdf.Forms
    Assembly:
    GemBox.Pdf.dll

    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).

    • C#
    • VB.NET
    public class PdfSignatureContent
    Public Class PdfSignatureContent
    Inheritance:
    System.Object
    PdfSignatureContent

    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.

    • C#
    • VB.NET
    public PdfHashAlgorithm HashAlgorithm { get; }
    Public ReadOnly Property HashAlgorithm As PdfHashAlgorithm
    Property Value
    PdfHashAlgorithm

    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.

    • C#
    • VB.NET
    public PdfSignaturePolicyIdentifier PolicyIdentifier { get; }
    Public ReadOnly Property PolicyIdentifier As PdfSignaturePolicyIdentifier
    Property Value
    PdfSignaturePolicyIdentifier

    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.

    • C#
    • VB.NET
    public PdfRSASignaturePadding RSASignaturePadding { get; }
    Public ReadOnly Property RSASignaturePadding As PdfRSASignaturePadding
    Property Value
    PdfRSASignaturePadding

    The RSA signature padding used if signer's certificate has an 'RSA' public key.

    SignerCertificate

    Gets the signer certificate contained in the PdfSignatureContent.

    • C#
    • VB.NET
    public PdfCertificate SignerCertificate { get; }
    Public ReadOnly Property SignerCertificate As PdfCertificate
    Property Value
    PdfCertificate

    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.

    • C#
    • VB.NET
    public PdfSignatureContent TimestampToken { get; }
    Public ReadOnly Property TimestampToken As PdfSignatureContent
    Property Value
    PdfSignatureContent

    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.

    • C#
    • VB.NET
    public PdfSignatureValidationInfo ValidationInfo { get; }
    Public ReadOnly Property ValidationInfo As PdfSignatureValidationInfo
    Property Value
    PdfSignatureValidationInfo

    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.

    • C#
    • VB.NET
    public byte[] Value { get; }
    Public ReadOnly Property Value As Byte()
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public byte[] GetRawData()
    Public Function GetRawData As Byte()
    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.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this PdfSignatureContent instance.

    Overrides
    System.Object.ToString()
    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).

    See Also

    PDF Specification ISO 32000-1:2008, section '12.8 Digital Signatures'
    PDF Specification ISO 32000-1:2008, section '12.8.3 Signature Interoperability'
    RFC 8017: PKCS #1: RSA Cryptography Specifications Version 2.2
    RFC 5652: Cryptographic Message Syntax (CMS)
    Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.