cete.dynamicpdf.certificate
Certificate
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a digital certificate.
public class Certificate
Public Class Certificate
Inheritance: Object → Certificate
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create a signature and sign it with a certificate.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Forms
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
'Create a signature form field
Dim signature As Signature = New Signature("SigField", 10, 10, 250, 100)
' Add signature field to the page
page.Elements.Add(signature)
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate from the file
Dim certificate As Certificate = New Certificate("C:\MyPersonalCertificate.pfx", "CertificatePassword")
' Certify the document referring the sign field
document.Certify("SigField", certificate, CertifyingPermission.NoChangesAllowed)
' Save the document
document.Draw("C:\MySignedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Create a signature form field
Signature signature = new Signature("SigField", 10, 10, 250, 100);
// Add signature field to the page
page.Elements.Add(signature);
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate from the file
Certificate certificate = new Certificate(@"C:\MyPersonalCertificate.pfx", "CertificatePassword");
// Certify the document referring the sign field
document.Certify("SigField", certificate, CertifyingPermission.NoChangesAllowed);
// Save the document
document.Draw(@"C:\MySignedDocument.pdf");
}
}
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater and it is not available for .NET standard
Constructors
Certificate(Byte[], String)
Initializes a new instance of a Certificate from the given data.
public Certificate(Byte[] certificateData, string password)
Public Sub New (certificateData As Byte(), password As String)
Parameters
- certificateData: Byte[]
Byte array containing the digital certificate with private key.
- password: String
Password for the certificate.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Certificate(StoreName, StoreLocation, String)
Initializes a new instance of a Certificate from the certificate store.
public Certificate(StoreName storeName, StoreLocation storeLocation, string certificateSubject)
Public Sub New (storeName As StoreName, storeLocation As StoreLocation, certificateSubject As String)
Parameters
- storeName: StoreName
Value of type StoreName
- storeLocation: StoreLocation
Value of type StoreLocation
- certificateSubject: String
A portion or full subject string corresponds to fetch the certificate from store.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Certificate(String)
Initializes a new instance of a Certificate from the certificate store.
public Certificate(string certificateSubject)
Public Sub New (certificateSubject As String)
Parameters
- certificateSubject: String
A portion or full subject string corresponds to fetch the certificate from store.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Default certificate store will be used.
Certificate(String, StoreLocation, String)
Initializes a new instance of a Certificate from the certificate store.
public Certificate(string storeName, StoreLocation storeLocation, string certificateSubject)
Public Sub New (storeName As String, storeLocation As StoreLocation, certificateSubject As String)
Parameters
- storeName: String
Store name where the certificate resides.
- storeLocation: StoreLocation
Value of type StoreLocation
- certificateSubject: String
A portion or full subject string corresponds to fetch the certificate from store.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Certificate(String, String)
Initializes a new instance of a Certificate from the given file.
public Certificate(string certificatePath, string password)
Public Sub New (certificatePath As String, password As String)
Parameters
- certificatePath: String
Physical file path to a digital certificate with private key.
- password: String
Password for the certificate.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Certificate(X509Certificate2)
Initializes a new instance of a Certificate from an X509Certificate2 certificate class.
public Certificate(X509Certificate2 certificate)
Public Sub New (certificate As X509Certificate2)
Parameters
- certificate: X509Certificate2
A digital certificate with private key.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: This class requires the .NET Framework 2.0 or greater.
Properties
IncludeWholeChain
Specifies how much of the X.509 certificate chain should be included in the signed data. Default value is true. If it is false, include option will be EndCertOnly.
public bool IncludeWholeChain { get; set; }
Public Property IncludeWholeChain As Boolean
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Issuer
Gets the complete issuer string from the certificate loaded.
public string Issuer { get; }
Public Property Issuer As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
SignatureType
Gets or sets type of signature.
public SignatureType SignatureType { get; set; }
Public Property SignatureType As SignatureType
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
SignSilently
Gets or sets to prompt for the selection of a signing Certificate.
public bool SignSilently { get; set; }
Public Property SignSilently As Boolean
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Subject
Gets the complete subject string from the certificate loaded.
public string Subject { get; }
Public Property Subject As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
SubjectName
Gets the subject name of the certificate loaded.
public string SubjectName { get; }
Public Property SubjectName As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
TimestampServerUrl
Get the Timestamp Server Url from the certificate loaded.
public string TimestampServerUrl { get; }
Public Property TimestampServerUrl As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Methods
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.