com.aspose.words
Class PdfDigitalSignatureHashAlgorithm
java.lang.Object
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.
Date signingTime = new Date();
options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", signingTime));
options.getDigitalSignatureDetails().setHashAlgorithm(PdfDigitalSignatureHashAlgorithm.SHA_256);
Assert.assertEquals(options.getDigitalSignatureDetails().getReason(), "Test Signing");
Assert.assertEquals(options.getDigitalSignatureDetails().getLocation(), "Aspose Office");
Assert.assertEquals(options.getDigitalSignatureDetails().getSignatureDate(), signingTime);
doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignature.pdf", options);
Field Summary |
static final int | SHA_1 = 0 | |
SHA-1 hash algorithm.
|
static final int | SHA_256 = 1 | |
SHA-256 hash algorithm.
|
static final int | SHA_384 = 2 | |
SHA-384 hash algorithm.
|
static final int | SHA_512 = 3 | |
SHA-512 hash algorithm.
|
static final int | MD_5 = 4 | |
SHA-1 hash algorithm.
|
SHA_1 = 0 | |
public static final int SHA_1 |
-
SHA-1 hash algorithm.
SHA_256 = 1 | |
public static final int SHA_256 |
-
SHA-256 hash algorithm.
SHA_384 = 2 | |
public static final int SHA_384 |
-
SHA-384 hash algorithm.
SHA_512 = 3 | |
public static final int SHA_512 |
-
SHA-512 hash algorithm.
MD_5 = 4 | |
public static final int MD_5 |
-
SHA-1 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.