PdfDigitalSignatureDetails Class

Contains details for a PDF digital signature.
Inheritance Hierarchy
SystemObject
  Aspose.Tasks.SavingPdfDigitalSignatureDetails

Namespace:  Aspose.Tasks.Saving
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.1
Syntax
public class PdfDigitalSignatureDetails

The PdfDigitalSignatureDetails type exposes the following members.

Constructors
  NameDescription
Public methodCode examplePdfDigitalSignatureDetails
Initializes a new instance of the PdfDigitalSignatureDetails class.
Properties
  NameDescription
Public propertyCode exampleCertificate
Gets or sets the certificate to sign with.
Public propertyCode exampleHashAlgorithm
Gets or sets the hash algorithm.
Public propertyCode exampleLocation
Gets or sets the location of signing.
Public propertyCode exampleReason
Gets or sets the reason of signing.
Public propertyCode exampleSignatureDate
Gets or sets the date of signing.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
At the moment digitally signing PDF documents is only available on .NET 2.0 or higher.
Examples
Shows how to work with PDF digital signature details.
var project = new Project(DataDir + "CreateProject2.mpp");

var options = new PdfSaveOptions();

var certificate = new X509Certificate2();

// create PDF signature details
var signatureDetails = new PdfDigitalSignatureDetails(
    // specify certificate
    certificate, 
    // specify a reason of signing
    "reason",
    // specify a location of signing
    "location", 
    // specify a date of signing
    new DateTime(2019, 1, 1), 
    // specify a hash algorithm of signing
    PdfDigitalSignatureHashAlgorithm.Sha1);

Console.WriteLine("Certificate: " + signatureDetails.Certificate);
Console.WriteLine("Reason: " + signatureDetails.Reason);
Console.WriteLine("Location: " + signatureDetails.Location);
Console.WriteLine("Signature Date: " + signatureDetails.SignatureDate);
Console.WriteLine("Hash Algorithm: " + signatureDetails.HashAlgorithm);

// set digital signature details
options.DigitalSignatureDetails = signatureDetails;

// save the project with specified encryption details
project.Save(OutDir + "WorkWithPdfEncryptionDetails_out.pdf", options);
See Also