Class Certificate
Wraps an X.509 certificate used for digitally signing a presentation. Provides a lightweight, presentation-focused view of the underlying X509Certificate2.
Used by PptxDigitalSignatureSaveOptions when signing PPTX packages.
Inherited Members
Namespace: DRIT.Presentation
Assembly: DRIT.Presentation.dll
Syntax
public sealed class Certificate
Constructors
Certificate(X509Certificate2)
Initializes a new instance of the Certificate class wrapping the specified X.509 certificate.
Declaration
public Certificate(X509Certificate2 certificate)
Parameters
| Type | Name | Description |
|---|---|---|
| X509Certificate2 | certificate | The X.509 certificate to wrap. Must not be null. |
Certificate(string, string)
Initializes a new instance of the Certificate class by loading a certificate from the specified file path.
Declaration
public Certificate(string path, string password = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path to a certificate file (.pfx, .p12, .cer). |
| string | password | The password for the certificate, if required. |
Properties
Issuer
Gets the issuer distinguished name of the certificate.
Declaration
public string Issuer { get; }
Property Value
| Type | Description |
|---|---|
| string |
NotAfter
Gets the not-after (expiration) date of the certificate.
Declaration
public DateTime? NotAfter { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
NotBefore
Gets the not-before validity date of the certificate.
Declaration
public DateTime? NotBefore { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Subject
Gets the subject distinguished name of the certificate.
Declaration
public string Subject { get; }
Property Value
| Type | Description |
|---|---|
| string |
SubjectCommonName
Gets the subject common name (CN) extracted from the certificate's subject.
Declaration
public string SubjectCommonName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Thumbprint
Gets the thumbprint (SHA-1 hash) of the certificate.
Declaration
public string Thumbprint { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetRawData()
Returns the raw certificate data as a byte array.
Declaration
public byte[] GetRawData()
Returns
| Type | Description |
|---|---|
| byte[] |
ToX509Certificate2()
Returns the underlying X509Certificate2.
Declaration
public X509Certificate2 ToX509Certificate2()
Returns
| Type | Description |
|---|---|
| X509Certificate2 |