Skip to content

# PDFCustomDigitalSignature

Namespace: O2S.Components.PDF4NET.DigitalSignatures

Defines the base class for custom digital signatures.

    public class PDFCustomDigitalSignature : PDFBaseDigitalSignature

Inheritance Object → PDFBaseDigitalSignature → PDFCustomDigitalSignature

Remarks

This class lets you build the entire signature object according to your rules.
Your class inherits from PDFCustomDigitalSignature and overrides the PDFCustomDigitalSignature.CreateSignature(Stream) method.

## Properties

### Certificate

Gets or sets the sign certificate.

    public X509Certificate2 Certificate { get; set; }

Property Value

X509Certificate2
A that represents the certificate used to sign the document.

Remarks

This property is not used by PDFDocumentTimeStamp signatures.

### ContactInfo

Gets or sets the contact information.

    public string ContactInfo { get; set; }

Property Value

String
Information provided by the signer to enable a recipient to contact the signer to verify the signature.

Remarks

This property should not be set for PDFDocumentTimeStamp signatures.

### CosDictionary

Gets the signature dictionary.

    public PDFCosDictionary CosDictionary { get; }

Property Value

PDFCosDictionary
The COS signature object for setting custom values for the signature.

### Location

Gets or sets the location.

    public string Location { get; set; }

Property Value

String
The CPU host name or physical location of the signing.

Remarks

This property should not be set for PDFDocumentTimeStamp signatures.

### Name

Gets or sets the name.

    public string Name { get; set; }

Property Value

String
The name of the person or authority signing the document.

Remarks

This property should not be set for PDFDocumentTimeStamp signatures.

### Reason

Gets or sets the sign reason.

    public string Reason { get; set; }

Property Value

String
The reason for the signing.

Remarks

This property should not be set for PDFDocumentTimeStamp signatures.

### SignatureDate

Gets or sets the sign date.

    public DateTime SignatureDate { get; set; }

Property Value

DateTime
The date and time when the signature was applied.

### SignatureDigestAlgorithm

Gets or sets the signature digest algorithm.

    public PDFDigitalSignatureDigestAlgorithm SignatureDigestAlgorithm { get; set; }

Property Value

PDFDigitalSignatureDigestAlgorithm
A PDFDigitalSignatureDigestAlgorithm enum member specifying the digest algorithm used in the computation of the digital signature.

## Methods

### CreateSignature(Stream)

Override this method to create your own custom signature.

    public Byte[] CreateSignature(Stream contentToBeSigned)

Parameters

`contentToBeSigned` Stream
The content of the PDF file over which the signature should be computed.

Returns

Byte[]
The full signature object.