Certificate

Represents a digital certificate.

public class Certificate
Public Class Certificate

Inheritance: ObjectCertificate

Licensing Info

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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.
Certificate(StoreName, StoreLocation, String)Initializes a new instance of a Certificate from the certificate store.
Certificate(String)Initializes a new instance of a Certificate from the certificate store.
Certificate(String, StoreLocation, String)Initializes a new instance of a Certificate from the certificate store.
Certificate(String, String)Initializes a new instance of a Certificate from the given file.
Certificate(X509Certificate2)Initializes a new instance of a Certificate from an X509Certificate2 certificate class.

Properties

IncludeWholeChainSpecifies 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.
IssuerGets the complete issuer string from the certificate loaded.
SignatureTypeGets or sets type of signature.
SignSilentlyGets or sets to prompt for the selection of a signing Certificate.
SubjectGets the complete subject string from the certificate loaded.
SubjectNameGets the subject name of the certificate loaded.
TimestampServerUrlGet the Timestamp Server Url from the certificate loaded.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF

In this topic