Click or drag to resize

PdfCertificate Class

Represents an X.509 certificate sent to others so that they can verify your digital signature with a public key contained in the certificate.
Inheritance Hierarchy
SystemObject
  SautinSoft.Pdf.SecurityPdfCertificate

Namespace: SautinSoft.Pdf.Security
Assembly: SautinSoft.Pdf (in SautinSoft.Pdf.dll) Version: 2024.11.26
Syntax
public sealed class PdfCertificate : IEquatable<PdfCertificate>

The PdfCertificate type exposes the following members.

Constructors
 NameDescription
Public methodPdfCertificate(Object)

Initializes a new instance of the PdfCertificate class from the specified source.

The certificate source is an instance of a X509Certificate2.

Public methodPdfCertificate(String) Initializes a new instance of the PdfCertificate class from a file with the specified file name.
Top
Properties
 NameDescription
Public propertySubject Gets the subject distinguished name from the certificate.
Public propertySubjectCommonName Gets the value of a Common Name attribute from Subject's distinguished name.
Top
Methods
 NameDescription
Public methodEquals(Object) Determines whether the specified Object is equal to this PdfCertificate instance.
(Overrides ObjectEquals(Object))
Public methodEquals(PdfCertificate) Determines whether the specified PdfCertificate is equal to this PdfCertificate instance.
Public methodStatic memberFromPem Creates a PdfCertificate from a PEM encoded certificate data. Froms the pem.
Public methodGetHashCode Returns a hash code for this PdfCertificate instance.
(Overrides ObjectGetHashCode)
Public methodGetRawData Gets the copy of raw data of a PdfCertificate.
Public methodToString Returns a String that represents this PdfCertificate instance.
(Overrides ObjectToString)
Top
Remarks

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

Another reason why SautinSoft.Pdf abstracts a certificate with a PdfCertificate class instead of using X509Certificate2 directly is to enable different implementations of a certificate. For example, either X509Certificate2 implementation from .NET or Org.BouncyCastle.X509.X509Certificate implementation from Bouncy Castle could be used.

See Also