PdfFileSignature

PdfFileSignature

Overview

PdfFileSignature is a class in Aspose.Pdf FOSS for Java. Inherits from: AutoCloseable.

Facade for working with PDF digital signatures.

Properties

NameTypeAccessDescription
signNamesList<String>ReadReturns the names of all signature fields in the document.
signatureNamesList<SignatureName>ReadReturns the names of all signature fields (both signed and unsigned).
blankSignNamesList<String>ReadReturns the names of unsigned (blank) signature fields.
containSignaturebooleanReadAlias for {@link #containsSignature()} matching the C# {@code IsContainSignature()} name.
totalRevisionintReadReturns the total number of signed revisions in the document.

Methods

SignatureDescription
PdfFileSignature()Creates a new empty {@code PdfFileSignature} instance.
PdfFileSignature(document: Document)Creates a {@code PdfFileSignature} bound to the specified document.
PdfFileSignature(inputFile: String)Creates a {@code PdfFileSignature} bound to the PDF at {@code inputFile}.
bindPdf(inputFile: String)Binds a PDF file to this signature facade.
bindPdf(inputStream: InputStream)Binds a PDF from an input stream.
bindPdf(document: Document)Binds an existing {@link Document} to this signature facade.
getSignNames()List<String>Returns the names of all signature fields in the document.
getSignatureNames(onlyActive: boolean)List<SignatureName>Returns the names of all signature fields in the document as
{@link SignatureName} objects with metadata about whether each field is signed.
getSignatureNames()List<SignatureName>Returns the names of all signature fields (both signed and unsigned).
getBlankSignNames()List<String>Returns the names of unsigned (blank) signature fields.
verifySignature(signatureName: SignatureName)booleanVerifies the digital signature of the specified signature field.
verifySignature(signName: String)booleanVerifies the digital signature of the specified signature field.
verifySignature(signName: String, options: ValidationOptions)booleanVerifies the digital signature with validation options.
verifySignature(signName: String, options: ValidationOptions, result: ValidationResult[])booleanVerifies the digital signature with validation options and returns a result.
verifySignature(signatureName: SignatureName, options: ValidationOptions)booleanVerifies the digital signature of the specified {@link SignatureName} with options.
isContainSignature()booleanAlias for {@link #containsSignature()} matching the C# {@code IsContainSignature()} name.
containsSignature()booleanReturns whether the document contains at least one signed signature field.
isSigned(signName: String)booleanReturns whether the specified signature field is signed.
getReason(signName: String)StringReturns the signing reason for the specified signature field.
getLocation(signName: String)StringReturns the signing location for the specified signature field.
getSignerName(signName: String)StringReturns the signer name for the specified signature field.
getDateTime(signName: String)DateReturns the signing date for the specified signature field.
getContactInfo(signName: String)StringReturns the contact info for the specified signature field.
save(outputFile: String)Saves the bound document to a file.
save(outputStream: OutputStream)Saves the bound document to an output stream.
close()Closes the signature facade and releases the bound document
(if this facade owns it).
sign(pageNumber: int, reason: String, contact: String, location: String, visible: boolean, rect: Rectangle, signature: Signature)Signs the document by creating a new signature field on the given page.
sign(fieldName: String, signature: Signature)Signs an existing signature field by name.
removeSignature(signName: String)Removes a signature from the specified signature field.
removeSignature(signName: String, removeField: boolean)Removes a signature from the specified signature field.
containsUsageRights()booleanReturns whether the document contains usage rights (UR3 dictionary in the document catalog).
removeUsageRights()Removes usage rights from the document.
getTotalRevision()intReturns the total number of signed revisions in the document.
getRevision(signName: String)intReturns the 1-based revision number for the specified signature field.
getRevision(signatureName: SignatureName)intReturns the 1-based revision number for the specified signature field.
isCoversWholeDocument(signName: String)booleanReturns whether the byte range of the named signature covers the
entire document (i.e.
coversWholeDocument(signatureName: SignatureName)booleanReturns whether the byte range of the named signature covers the
entire document.
getReason(name: SignatureName)String{@link #getReason(String)} overload taking {@link SignatureName}.
getLocation(name: SignatureName)String{@link #getLocation(String)} overload taking {@link SignatureName}.
getSignerName(name: SignatureName)String{@link #getSignerName(String)} overload taking {@link SignatureName}.
getDateTime(name: SignatureName)Date{@link #getDateTime(String)} overload taking {@link SignatureName}.
getContactInfo(name: SignatureName)String{@link #getContactInfo(String)} overload taking {@link SignatureName}.

See Also