public interface DocAssuranceService
Modifier and Type | Method and Description |
---|---|
Document |
addInvisibleSignatureField(Document inDoc,
String signatureFieldName,
FieldMDPOptionSpec fieldMDPOptionsSpec,
PDFSeedValueOptionSpec seedValueOptionsSpec,
UnlockOptions unlockOptions)
Creates an invisible signature field in the PDF document.
|
Document |
addSignatureField(Document inDoc,
String signatureFieldName,
Integer pageNo,
PositionRectangle positionRectangle,
FieldMDPOptionSpec fieldMDPOptionsSpec,
PDFSeedValueOptionSpec seedValueOptionsSpec,
UnlockOptions unlockOptions)
Creates a visible signature field within the PDF document.
|
Document |
clearSignatureField(Document inDoc,
String signatureFieldName,
UnlockOptions unlockOptions)
Clears the specified signature field.
|
PDFSignatureField |
getCertifyingSignatureField(Document inDoc,
UnlockOptions unlockOptions)
Returns the signature field that was used to certify the document.
|
GetUsageRightsResult |
getCredentialUsageRights(String credentialAlias,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Returns the usage rights information of the credential specified by given credentialAlias.
|
GetUsageRightsResult |
getDocumentUsageRights(Document inDocument,
UnlockOptions unlockOptions)
Returns the usage rights information of the given Document.
|
EncryptionTypeResult |
getPDFEncryption(Document inDoc)
Returns the type of security used for a document
|
PDFSignature |
getSignature(Document doc,
String signatureFieldName,
UnlockOptions unlockOptions)
Returns signature data for a given signature field.
|
List<PDFSignatureField> |
getSignatureFieldList(Document inDoc,
UnlockOptions unlockOptions)
Returns a list of all the signature fields located within a PDF document.
|
Document |
modifySignatureField(Document inDoc,
String signatureFieldName,
PDFSignatureFieldProperties pdfSignatureFieldProperties,
UnlockOptions unlockOptions)
Modifies a signature field's signature field lock dictionary and seed value dictionary values.
|
Document |
removePDFCertificateSecurity(Document inDoc,
String alias,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Returns an unsecured Document given a certificate-encrypted Document.
|
Document |
removePDFPasswordSecurity(Document inDoc,
String password)
Returns a new Document that has security removed given a password protected document as input.
|
Document |
removeSignatureField(Document inDoc,
String signatureFieldName,
UnlockOptions unlockOptions)
Removes the specified signature field.
|
Document |
removeUsageRights(Document inDocument,
UnlockOptions unlockOptions)
Removes the usage rights for the given Document.
|
Document |
secureDocument(Document inDoc,
EncryptionOptions encryptionOptions,
SignatureOptions signatureOptions,
ReaderExtensionOptions readerExtensionOptions,
UnlockOptions unlockOptions)
secureDocument enables you to encrypt, sign/certify, reader extend a PDF Document either individually
or in any combination in the given order.
|
PDFSignatureVerificationInfo |
verify(Document inDoc,
String signatureFieldName,
RevocationCheckStyle revocationCheckStyle,
VerificationTime verificationTime,
ValidationPreferences dssPrefs,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Operation to validate a signed signature field.
|
PDFDocumentVerificationInfo |
verifyDocument(Document doc,
RevocationCheckStyle revocationCheckStyle,
VerificationTime verificationTime,
ValidationPreferences prefStore,
org.apache.sling.api.resource.ResourceResolver resourceResolver) |
Document secureDocument(Document inDoc, EncryptionOptions encryptionOptions, SignatureOptions signatureOptions, ReaderExtensionOptions readerExtensionOptions, UnlockOptions unlockOptions) throws Exception
inDoc
- Document
input PDF DocumentencryptionOptions
- EncryptionOptions
Includes the arguments required for Encrypting a PDF DocsignatureOptions
- SignatureOptions
Includes the options required for Signing/Certifying a PDF DocreaderExtensionOptions
- ReaderExtensionOptions
Includes the options required for Reader Extending a PDF DocunlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Document
object that represents a secure PDF documentException
Document addSignatureField(Document inDoc, String signatureFieldName, Integer pageNo, PositionRectangle positionRectangle, FieldMDPOptionSpec fieldMDPOptionsSpec, PDFSeedValueOptionSpec seedValueOptionsSpec, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field. This is a required parameter
and cannot be null.pageNumber
- The page number on which the signature field is added. Valid
values are 1 to the number of pages contained within the
document. This is a required parameter and cannot be null.positionRectangle
- A PositionRectangle
object that specifies the
position for the signature field. This is a required parameter
and cannot be null. If the specified rectangle does not lie at
least partially on the crop box of the specified page, an
InvalidArgumentException
is thrown. Also,
neither the height or width value of the specified rectangle
can be 0 or negative. Lower left X or lower left Y coordinates
can be 0 or greater but not negative, and are relative to the
crop box of the page.fieldMDPOptionsSpec
- A FieldMDPOptionSpec
object that specifies the
PDF document fields that are locked after the signature field
is signed. This is an optional parameter and can be null.seedValueOptionsSpec
- A SeedValueOptions
object that specifies the
various seed values for the field. This is an optional
parameter and can be null.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Document
object that represents a PDF document with a newly added signature field.Exception
Document addInvisibleSignatureField(Document inDoc, String signatureFieldName, FieldMDPOptionSpec fieldMDPOptionsSpec, PDFSeedValueOptionSpec seedValueOptionsSpec, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF..signatureFieldName
- The name of the signature field. This is a required parameter
and cannot be null.fieldMDPOptionsSpec
- A FieldMDPOptionSpec
object that specifies the
PDF document fields that are locked after the signature field
is signed. This is an optional parameter and can be null.seedValueOptionsSpec
- A SeedValueOptions
object that specifies the
various seed values for the field. This is an optional
parameter and can be null.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Document
object that represents a PDF document with a newly added invisible signature field.Exception
Document clearSignatureField(Document inDoc, String signatureFieldName, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Document
object that represents a
PDF document that contains an empty signature field.Exception
PDFSignatureField getCertifyingSignatureField(Document inDoc, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.PDFSignatureField
object that holds information
about the certified signature.Exception
PDFSignature getSignature(Document doc, String signatureFieldName, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field that contains a signature. The
fully qualified name of the signature field should be
specified. When using a PDF document that is based on an XFA
form, then the partial name of the signature field can be
used. For example,
form1[0].#subform[1].SignatureField3[3]
can be
specified as SignatureField3[3]
.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.PDFSignature
object which contains a signature
and information about the filter and subfilters which is used for
validating the signature and also the certificates embedded in
the PDF document.Exception
Document removeSignatureField(Document inDoc, String signatureFieldName, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field to remove. The fully qualified
name of the signature field should be specified. When using a
PDF document that is based on an XFA form, then the partial
name of the signature field can be used. For example,
form1[0].#subform[1].SignatureField3[3]
can be
specified as SignatureField3[3]
.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Exception
clearSignatureField
List<PDFSignatureField> getSignatureFieldList(Document inDoc, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.List
of
PDFSignatureField
objects.Exception
Document modifySignatureField(Document inDoc, String signatureFieldName, PDFSignatureFieldProperties pdfSignatureFieldProperties, UnlockOptions unlockOptions) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field. This is a required parameter
and cannot be null.pdfSignatureFieldProperties
- A PDFSignatureFieldProperties
object that specifies
information about the PDFSeedValueOptionSpec
and FieldMDPOptionSpec
values of the
signature field.unlockOptions
- UnlockOptions
includes the parameters require to unlock an encrypted file, This is required only
if the file is encrypted.Document
object that represents a PDF document with the modified signature field.Exception
PDFSignatureVerificationInfo verify(Document inDoc, String signatureFieldName, RevocationCheckStyle revocationCheckStyle, VerificationTime verificationTime, ValidationPreferences dssPrefs, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws Exception
inDoc
- - Document
object containing PDF.signatureFieldName
- The name of the signature field to be validated. either fully qualified name or partial name can be givenrevocationCheckStyle
- The option to govern the revocation checking of the certificates encountered during validationverificationTime
- The time at which the signature should be validateddssPrefs
- Preferences to control various validation configurations
For an encrypted document, set unlock options by using setUnlockOptions()resourceResolver
- - resource resolver to the granite trust storePDFSignatureVerificationInfo
object containing verification info of the signature field.SignaturesBaseException
DocAssuranceException
Exception
Document removePDFPasswordSecurity(Document inDoc, String password) throws Exception
inDoc
- an Document supplied as input. It must be password protectedpassword
- either a document open or permission password to use for removing security from the documentDocument
representing unprotected PDF Document.Exception
EncryptionTypeResult getPDFEncryption(Document inDoc) throws Exception
inDoc
- a Document supplied as input. It may or may not be encrypted.Exception
Document removePDFCertificateSecurity(Document inDoc, String alias, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws Exception
inDoc
- -
A Document object that represents the certificate-encrypted PDF document.alias
- -
The alias that corresponds to the key in Granite Trust Store that is used to remove certificate-based encryption from the PDF document.resourceResolver
- ResourceResolver
to access the key store of the particular user to fetch the CredentialDocument
representing unprotected PDF Document.
Throws:
Exception - If the PDF document is not encrypted or if the alias value is invalid.Exception
PDFDocumentVerificationInfo verifyDocument(Document doc, RevocationCheckStyle revocationCheckStyle, VerificationTime verificationTime, ValidationPreferences prefStore, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws DocAssuranceException, Exception
doc
- The signed pdf documentrevocationCheckStyle
- The option to govern the revocation checking of the certificates encountered during validationverificationTime
- The time at which the signature should be validateddssPrefs
- Preferences to control various validation configurations
For an encrypted document, set unlock options by using setUnlockOptions()isFIPSmode
- Governs whether processing happens using US Federal FIPS modecertProvs
- Providers providing access to certificate storecrlProvs
- Providers providing access to stored crls storepdfDocVer
- Provides mechanism to access previous revisions of a pdf document. If null, default implementation is used.PDFDocumentVerificationInfo
that represents the verification info of the input PDF Document.SignaturesBaseException
DocAssuranceException
Exception
Document removeUsageRights(Document inDocument, UnlockOptions unlockOptions) throws DocAssuranceException, Exception
inDocument
- The document to remove usage rights from.DocAssuranceException
Exception
GetUsageRightsResult getDocumentUsageRights(Document inDocument, UnlockOptions unlockOptions) throws DocAssuranceException, Exception
inDocument
- The document to get usage rights information from.DocAssuranceException
Exception
GetUsageRightsResult getCredentialUsageRights(String credentialAlias, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws ReaderExtensionsException
credentialAlias
- The credentialAlias that specifies the credential.credentialPassword
- The password of the credential if the credential is encrypted,
null needs to be used if the credential is not encrypted.ReaderExtensionsException
- if there is an exception accessing the specified
credential or getting the usage rights information.Copyright © 1982–2022 Adobe Systems Inc.. All rights reserved.