com.aspose.words
Class PdfDigitalSignatureHashAlgorithm

java.lang.Object
    extended by com.aspose.words.PdfDigitalSignatureHashAlgorithm

public class PdfDigitalSignatureHashAlgorithm 
extends java.lang.Object

Utility class containing constants. Specifies a digital hash algorithm used by a digital signature.

Example:

Shows how to sign a generated PDF document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Contents of signed PDF.");

CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");

// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions options = new PdfSaveOptions();

// Configure the "DigitalSignatureDetails" object of the "SaveOptions" object to
// digitally sign the document as we render it with the "Save" method.
Calendar calendar = Calendar.getInstance();
calendar.set(2015, Calendar.JULY, 20);
Date signingTime = calendar.getTime();
options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "My Office", signingTime));
options.getDigitalSignatureDetails().setHashAlgorithm(PdfDigitalSignatureHashAlgorithm.RIPE_MD_160);

Assert.assertEquals(options.getDigitalSignatureDetails().getReason(), "Test Signing");
Assert.assertEquals(options.getDigitalSignatureDetails().getLocation(), "My Office");
Assert.assertEquals(DocumentHelper.getLocalDate(options.getDigitalSignatureDetails().getSignatureDate()), DocumentHelper.getLocalDate(signingTime));

doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignature.pdf", options);

Field Summary
static final intSHA_256 = 0
           SHA-256 hash algorithm.
static final intSHA_384 = 1
           SHA-384 hash algorithm.
static final intSHA_512 = 2
           SHA-512 hash algorithm.
static final intRIPE_MD_160 = 3
           RIPEMD-160 hash algorithm.
 

Field Detail

SHA_256 = 0

public static final int SHA_256
SHA-256 hash algorithm.

SHA_384 = 1

public static final int SHA_384
SHA-384 hash algorithm.

SHA_512 = 2

public static final int SHA_512
SHA-512 hash algorithm.

RIPE_MD_160 = 3

public static final int RIPE_MD_160
RIPEMD-160 hash algorithm.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.