Interface DocAssuranceService


  • @ProviderType
    public interface DocAssuranceService
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Document addInvisibleSignatureField​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.client.types.FieldMDPOptionSpec fieldMDPOptionsSpec, com.adobe.fd.signatures.client.types.PDFSeedValueOptionSpec seedValueOptionsSpec, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Creates an invisible signature field in the PDF document.
      Document addSignatureField​(Document inDoc, java.lang.String signatureFieldName, java.lang.Integer pageNumber, com.adobe.fd.signatures.client.types.PositionRectangle positionRectangle, com.adobe.fd.signatures.client.types.FieldMDPOptionSpec fieldMDPOptionsSpec, com.adobe.fd.signatures.client.types.PDFSeedValueOptionSpec seedValueOptionsSpec, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Creates a visible signature field within the PDF document.
      Document applyDocumentTimeStamp​(Document inDoc, com.adobe.fd.signatures.client.types.VerificationTime verificationTime, com.adobe.fd.signatures.pdf.inputs.ValidationPreferences dssPrefs, ResourceResolver resourceResolver, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      applies the TimeStamp Signaure to PDF document as per PAdES 4 specification
      Document clearSignatureField​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Clears the specified signature field.
      com.adobe.fd.signatures.client.types.PDFSignatureField getCertifyingSignatureField​(Document inDoc, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Returns the signature field that was used to certify the PDF document.
      com.adobe.fd.encryption.client.EncryptionTypeResult getPDFEncryption​(Document inDoc)
      Returns the type of security used for a PDF document
      com.adobe.fd.signatures.client.types.PDFSignature getSignature​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Returns signature data for a given signature field.
      java.util.List<com.adobe.fd.signatures.client.types.PDFSignatureField> getSignatureFieldList​(Document inDoc, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Returns a list of all the signature fields located within a PDF document.
      Document modifySignatureField​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.client.types.PDFSignatureFieldProperties pdfSignatureFieldProperties, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Modifies a signature field's signature field lock dictionary and seed value dictionary values.
      Document removePDFCertificateSecurity​(Document inDoc, java.lang.String alias, ResourceResolver resourceResolver)
      Returns an unsecured PDF document given a certificate-encrypted PDF document.
      Document removePDFPasswordSecurity​(Document inDoc, java.lang.String password)
      Returns a new PDF document that has security removed given a password protected PDF document as input.
      Document removeSignatureField​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      Removes the specified signature field.
      Document secureDocument​(Document inDoc, EncryptionOptions encryptionOptions, SignatureOptions signatureOptions, com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
      secureDocument enables you to encrypt, sign/certify a PDF document either individually or in any combination in the given order.
      com.adobe.fd.signatures.client.types.PDFSignatureVerificationInfo verify​(Document inDoc, java.lang.String signatureFieldName, com.adobe.fd.signatures.pki.client.types.common.RevocationCheckStyle revocationCheckStyle, com.adobe.fd.signatures.client.types.VerificationTime verificationTime, com.adobe.fd.signatures.pdf.inputs.ValidationPreferences dssPrefs, ResourceResolver resourceResolver)
      Operation to validate a signed signature field.
      com.adobe.fd.signatures.client.types.PDFDocumentVerificationInfo verifyDocument​(Document inDoc, com.adobe.fd.signatures.pki.client.types.common.RevocationCheckStyle revocationCheckStyle, com.adobe.fd.signatures.client.types.VerificationTime verificationTime, com.adobe.fd.signatures.pdf.inputs.ValidationPreferences prefStore, ResourceResolver resourceResolver)  
    • Method Detail

      • secureDocument

        Document secureDocument​(Document inDoc,
                                EncryptionOptions encryptionOptions,
                                SignatureOptions signatureOptions,
                                com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                         throws java.lang.Exception
        secureDocument enables you to encrypt, sign/certify a PDF document either individually or in any combination in the given order. To access any of the above functionality you have to pass the corresponding argument. If null, it would be assumed that the particular processing is not required.
        Parameters:
        inDoc - Document input PDF document
        encryptionOptions - EncryptionOptions Includes the arguments required for Encrypting a PDF Doc
        signatureOptions - SignatureOptions Includes the options required for Signing/Certifying a PDF Doc
        unlockOptions - UnlockOptions includes the parameters require to unlock an encrypted file, This is required only if the file is encrypted.
        Returns:
        A Document object that represents a secure PDF document
        Throws:
        java.lang.Exception - if unable to encrypt, sign/certify the PDF document.
      • addSignatureField

        Document addSignatureField​(Document inDoc,
                                   java.lang.String signatureFieldName,
                                   java.lang.Integer pageNumber,
                                   com.adobe.fd.signatures.client.types.PositionRectangle positionRectangle,
                                   com.adobe.fd.signatures.client.types.FieldMDPOptionSpec fieldMDPOptionsSpec,
                                   com.adobe.fd.signatures.client.types.PDFSeedValueOptionSpec seedValueOptionsSpec,
                                   com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                            throws java.lang.Exception
        Creates a visible signature field within the PDF document. This method is not supported when working with dynamic PDF documents.
        Parameters:
        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 PDF 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.
        Returns:
        A Document object that represents a PDF document with a newly added signature field.
        Throws:
        java.lang.Exception - if unable to create a visible signature field within the PDF document.
      • addInvisibleSignatureField

        Document addInvisibleSignatureField​(Document inDoc,
                                            java.lang.String signatureFieldName,
                                            com.adobe.fd.signatures.client.types.FieldMDPOptionSpec fieldMDPOptionsSpec,
                                            com.adobe.fd.signatures.client.types.PDFSeedValueOptionSpec seedValueOptionsSpec,
                                            com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                                     throws java.lang.Exception
        Creates an invisible signature field in the PDF document. This method is not supported when working with dynamic PDF documents.
        Parameters:
        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.
        Returns:
        A Document object that represents a PDF document with a newly added invisible signature field.
        Throws:
        java.lang.Exception - if unable to create an invisible signature field in the PDF document.
      • clearSignatureField

        Document clearSignatureField​(Document inDoc,
                                     java.lang.String signatureFieldName,
                                     com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                              throws java.lang.Exception
        Clears the specified signature field. After a signature field is cleared, it can be signed or certified again.
        Parameters:
        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.
        Returns:
        A Document object that represents a PDF document that contains an empty signature field.
        Throws:
        java.lang.Exception - if unable to clear the specified signature field.
      • getCertifyingSignatureField

        com.adobe.fd.signatures.client.types.PDFSignatureField getCertifyingSignatureField​(Document inDoc,
                                                                                           com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                                                                                    throws java.lang.Exception
        Returns the signature field that was used to certify the PDF document.
        Parameters:
        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.
        Returns:
        A PDFSignatureField object that holds information about the certified signature.
        Throws:
        java.lang.Exception - if unable to retrieve the specified signature field.
      • getSignature

        com.adobe.fd.signatures.client.types.PDFSignature getSignature​(Document inDoc,
                                                                       java.lang.String signatureFieldName,
                                                                       com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                                                                throws java.lang.Exception
        Returns signature data for a given signature field.
        Parameters:
        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.
        Returns:
        A 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.
        Throws:
        java.lang.Exception - if unable to retrieve signature data from the specified field.
      • removeSignatureField

        Document removeSignatureField​(Document inDoc,
                                      java.lang.String signatureFieldName,
                                      com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                               throws java.lang.Exception
        Removes the specified signature field. You cannot remove a signature field if it is signed or certified. First, you must clear the signature.
        Parameters:
        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.
        Returns:
        A Document object that represents a PDF document that contains an empty signature field.
        Throws:
        java.lang.Exception - if unable to remove the specified signature field.
        See Also:
        clearSignatureField
      • getSignatureFieldList

        java.util.List<com.adobe.fd.signatures.client.types.PDFSignatureField> getSignatureFieldList​(Document inDoc,
                                                                                                     com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                                                                                              throws java.lang.Exception
        Returns a list of all the signature fields located within a PDF document.
        Parameters:
        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.
        Returns:
        A List of PDFSignatureField objects.
        Throws:
        java.lang.Exception - if unable to retrieve all signature fields from the PDF document.
      • modifySignatureField

        Document modifySignatureField​(Document inDoc,
                                      java.lang.String signatureFieldName,
                                      com.adobe.fd.signatures.client.types.PDFSignatureFieldProperties pdfSignatureFieldProperties,
                                      com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                               throws java.lang.Exception
        Modifies a signature field's signature field lock dictionary and seed value dictionary values. A field lock dictionary specifies a list of fields which are locked once the signature field is signed. Any changes to the locked fields subsequent to the signing of this signature field invalidates the signature. A seed value dictionary contains entries that constrain information that is used at the time the signature is applied. For example, you can specify form fields that are locked when the PDF document is signed. Once a field is locked, its value cannot be modified.
        Parameters:
        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.
        Returns:
        A Document object that represents a PDF document with the modified signature field.
        Throws:
        java.lang.Exception - if unable to modify the signature field.
      • verify

        com.adobe.fd.signatures.client.types.PDFSignatureVerificationInfo verify​(Document inDoc,
                                                                                 java.lang.String signatureFieldName,
                                                                                 com.adobe.fd.signatures.pki.client.types.common.RevocationCheckStyle revocationCheckStyle,
                                                                                 com.adobe.fd.signatures.client.types.VerificationTime verificationTime,
                                                                                 com.adobe.fd.signatures.pdf.inputs.ValidationPreferences dssPrefs,
                                                                                 ResourceResolver resourceResolver)
                                                                          throws java.lang.Exception
        Operation to validate a signed signature field.
        Parameters:
        inDoc - - Document object containing PDF.
        signatureFieldName - The name of the signature field to be validated. either fully qualified name or partial name can be given
        revocationCheckStyle - The option to govern the revocation checking of the certificates encountered during validation
        verificationTime - The time at which the signature should be validated
        dssPrefs - Preferences to control various validation configurations For an encrypted PDF document, set unlock options by using setUnlockOptions()
        resourceResolver - - resource resolver to the granite trust store
        Returns:
        PDFSignatureVerificationInfo object containing verification info of the signature field.
        Throws:
        java.lang.Exception - if unable to validate the signed signature field.
      • removePDFPasswordSecurity

        Document removePDFPasswordSecurity​(Document inDoc,
                                           java.lang.String password)
                                    throws java.lang.Exception
        Returns a new PDF document that has security removed given a password protected PDF document as input.
        Parameters:
        inDoc - an PDF document supplied as input. It must be password protected
        password - either a PDF document open or permission password to use for removing security from the PDF document
        Returns:
        Document representing unprotected PDF document.
        Throws:
        java.lang.Exception - if unable to remove password security.
      • getPDFEncryption

        com.adobe.fd.encryption.client.EncryptionTypeResult getPDFEncryption​(Document inDoc)
                                                                      throws java.lang.Exception
        Returns the type of security used for a PDF document
        Parameters:
        inDoc - a PDF document supplied as input. It may or may not be encrypted.
        Returns:
        EncryptionTypeResult containing an enum for type of encryption if any on the supplied PDF document
        Throws:
        java.lang.Exception - if unable to get the type of security used for the PDF document.
      • removePDFCertificateSecurity

        Document removePDFCertificateSecurity​(Document inDoc,
                                              java.lang.String alias,
                                              ResourceResolver resourceResolver)
                                       throws java.lang.Exception
        Returns an unsecured PDF document given a certificate-encrypted PDF document. After certificate-based encryption is removed from a PDF document, it is no longer secure.
        Parameters:
        inDoc - - A PDF 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 Credential
        Returns:
        Document representing unprotected PDF document.
        Throws:
        java.lang.Exception - - If the PDF document is not encrypted or if the alias value is invalid.
      • verifyDocument

        com.adobe.fd.signatures.client.types.PDFDocumentVerificationInfo verifyDocument​(Document inDoc,
                                                                                        com.adobe.fd.signatures.pki.client.types.common.RevocationCheckStyle revocationCheckStyle,
                                                                                        com.adobe.fd.signatures.client.types.VerificationTime verificationTime,
                                                                                        com.adobe.fd.signatures.pdf.inputs.ValidationPreferences prefStore,
                                                                                        ResourceResolver resourceResolver)
                                                                                 throws DocAssuranceException,
                                                                                        java.lang.Exception
        Parameters:
        inDoc - The signed PDF document
        revocationCheckStyle - The option to govern the revocation checking of the certificates encountered during validation
        verificationTime - The time at which the signature should be validated
        prefStore - Preferences to control various validation configurations For an encrypted PDF document, set unlock options by using setUnlockOptions()
        resourceResolver - ResourceResolver to access the key store of the particular user to fetch the Credential
        Returns:
        PDFDocumentVerificationInfo that represents the verification info of the input PDF document.
        Throws:
        DocAssuranceException - if unable to get verification information from the PDF document.
        java.lang.Exception - if unable to get verification information from the PDF document.
      • applyDocumentTimeStamp

        Document applyDocumentTimeStamp​(Document inDoc,
                                        com.adobe.fd.signatures.client.types.VerificationTime verificationTime,
                                        com.adobe.fd.signatures.pdf.inputs.ValidationPreferences dssPrefs,
                                        ResourceResolver resourceResolver,
                                        com.adobe.fd.signatures.pdf.inputs.UnlockOptions unlockOptions)
                                 throws java.lang.Exception
        applies the TimeStamp Signaure to PDF document as per PAdES 4 specification
        Parameters:
        inDoc - Document object containing PDF.
        verificationTime - -The time at which the signature should be validated
        dssPrefs - -Preferences to control various validation configurations
        resourceResolver - -Resource resolver to the granite trust store
        unlockOptions - UnlockOptions includes the parameters require to unlock an encrypted file, This is required only if the file is encrypted.
        Returns:
        Document containing the timestamped PDF document.
        Throws:
        java.lang.Exception - if unable to apply a timestamp signature to the supplied PDF document.