Back to Devexpress

ICrlClient Interface

officefileapi-devexpress-dot-office-dot-digitalsignatures-b15a5032.md

latest3.5 KB
Original Source

ICrlClient Interface

Allows you to send a CLR request for specific a certificate.

Namespace : DevExpress.Office.DigitalSignatures

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public interface ICrlClient
vb
Public Interface ICrlClient

The following members return ICrlClient objects:

Remarks

The CrlClient class is the default ICrlClient interface implementation.

Pass the ICrlClient instance to the Pkcs7Signer object constructor, as shown below:

csharp
using DevExpress.Pdf;
using DevExpress.Office.DigitalSignatures;
using DevExpress.Office.Tsp;

using (var signer = new PdfDocumentSigner("Document.pdf"))
{
    IOcspClient ocspClient = new OcspClient();
    ICrlClient crlClient = new CrlClient();

    // the freetsa client is used for demonstration purposes
    ITsaClient tsaClient = new TsaClient(new Uri(@"https://freetsa.org/tsr"), HashAlgorithmType.SHA256);

    // Create a PKCS#7 signature:
    Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123",
     HashAlgorithmType.SHA256, tsaClient, ocspClient, crlClient, PdfSignatureProfile.PAdES_BES);

    // Create a new signature field:
    var signatureFieldInfo = new PdfSignatureFieldInfo(1);
    signatureFieldInfo.Name = "SignatureField";
    signatureFieldInfo.SignatureBounds = new PdfRectangle(10, 10, 150, 150);

    // Apply a signature with a new signature:
    var signature =
    new PdfSignatureBuilder(pkcs7Signature, signatureFieldInfo);

    // Sign and save the document:
    signer.SaveDocument("SignedDocument.pdf", signature);
}
vb
Imports DevExpress.Pdf
Imports DevExpress.Office.DigitalSignatures
Imports DevExpress.Office.Tsp

Using signer = New PdfDocumentSigner("Document.pdf")
  Dim ocspClient As IOcspClient = New OcspClient()
  Dim crlClient As ICrlClient = New CrlClient()

  ' the freetsa client is used for demonstration purposes
  Dim tsaClient As ITsaClient = New TsaClient(New Uri("https://freetsa.org/tsr"), HashAlgorithmType.SHA256)

  ' Create a PKCS#7 signature:
  Dim pkcs7Signature As New Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256, tsaClient, ocspClient, crlClient, PdfSignatureProfile.PAdES_BES)

  ' Create a new signature field:
  Dim signatureFieldInfo = New PdfSignatureFieldInfo(1)
  signatureFieldInfo.Name = "SignatureField"
  signatureFieldInfo.SignatureBounds = New PdfRectangle(10, 10, 150, 150)

  ' Apply a signature with a new signature field:
  Dim signature = New PdfSignatureBuilder(pkcs7Signature, signatureFieldInfo)

  ' Sign and save the document:
  signer.SaveDocument("SignedDocument.pdf", signature)
End Using

See Also

ICrlClient Members

DevExpress.Office.DigitalSignatures Namespace