Click or drag to resize

PdfDigitalId Class

A digital ID used to sign and encrypt documents.

The certificate that comes with your digital ID is sent to others so that they can verify your signature.

The most secure digital IDs are issued by trusted Certificate authorities and are based on secure devices like smart card or token. Some are based on files.

Inheritance Hierarchy
SystemObject
  SautinSoft.Pdf.SecurityPdfDigitalId
    SautinSoft.Pdf.SecurityPdfDelayOrReSignDigitalId
    SautinSoft.Pdf.SecurityPdfPkcs11DigitalId

Namespace: SautinSoft.Pdf.Security
Assembly: SautinSoft.Pdf (in SautinSoft.Pdf.dll) Version: 2025.3.13
Syntax
public class PdfDigitalId

The PdfDigitalId type exposes the following members.

Constructors
 NameDescription
Public methodPdfDigitalId(Object)

Initializes a new instance of the PdfDigitalId class 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.

Public methodPdfDigitalId(String, String)

Initializes a new instance of the PdfDigitalId class from a file with the specified file name and the password protecting the private key.

The most common format for such files is a PKCS#12 file, which uses .pfx or .p12 file extension and is a password protected storage container for digital IDs containing the public key (Certificate) and the associated private key.

Top
Properties
 NameDescription
Public propertyCertificate Gets or sets the certificate.
Top
Methods
 NameDescription
Public methodToString Returns a String that represents this PdfDigitalId instance.
(Overrides ObjectToString)
Top
Remarks

SautinSoft.Pdf doesn't use X509Certificate2 class to represent a digital ID because X509Certificate2 creates a file that holds the private key and another file that holds the certificate with the public key (in various locations on a hard drive) and on some operating systems and platforms those files are not deleted unless Reset method is called. This creation of files prevents usages of digital IDs in Medium Trust.

Another reason why SautinSoft.Pdf abstracts a digital ID with a PdfDigitalId class instead of using X509Certificate2 directly is to enable different implementations of a digital ID. For example, either X509Certificate2 implementation from .NET or Org.BouncyCastle.X509.X509Certificate with Org.BouncyCastle.Crypto.AsymmetricKeyParameter (private key) implementation from Bouncy Castle could be used.

Lastly, SautinSoft.Pdf abstracts a digital ID with a PdfDigitalId class to enable usage of signers for which private key parameters cannot be exported into .NET or Bouncy Castle implementation. These are, for example, Hardware Security Module (HSM), USB token, smart card or a web service and their functionality is called when overriding SignHash(Byte, PdfHashAlgorithm, PdfRSASignaturePadding) method.

See Also