com.adobe.livecycle.encryption.client
Class EncryptionServiceClient

java.lang.Object
  extended by com.adobe.livecycle.encryption.client.EncryptionServiceClient

public class EncryptionServiceClient
extends java.lang.Object

Enables you to create a Java object that invokes operations that belong to the Encryption service. You can encrypt a PDF document with a password or a certificiate thereby securing its contents. You can encrypt the entire PDF document, including its content, metadata, and attachments, everything other than its metadata, or just its attachments.

When you encrypt a PDF document with a password, you must specify two password values. The first password value, the open password, enables the PDF document to be opened in Adobe Reader or Acrobat. The other password value, the permission password, is used when removing password-based encryption from a PDF document. To see an object of this type used in a code example, see the Encrypting a PDF document using the Java API quick start in Programming with LiveCycle ES4.


Constructor Summary
EncryptionServiceClient(ServiceClientFactory serviceClientFactory)
          A constructor that creates an EncryptionServiceClient object.
 
Method Summary
 Document decryptXML(Document inXMLDoc, java.util.Set aliases)
          Returns a decrypted xml document decrypted with the set of private keys referred to by the Truststore Credential Aliases.
 Document encryptPDFUsingCertificates(Document inPDFDoc, java.util.List pkiIdentities, CertificateEncryptionOptionSpec optionSpec)
          Returns a certificate-encrypted PDF document.
 Document encryptPDFUsingPassword(Document inPDFDoc, PasswordEncryptionOptionSpec options)
          Returns a password-encrypted PDF document.
 Document encryptXML(Document inXMLDoc, java.util.Set encRecps, EncryptionAlgorithm encAlg, java.lang.Boolean isXFA)
          Returns an encrypted xml document encrypted for recipients represented by encRecps using the encryption algorithm encAlg
 EncryptionTypeResult getPDFEncryption(Document inPDFDoc)
          Returns an EncryptionTypeResult value that specifies the type of security that is used to secure the PDF document.
 Document removePDFCertificateSecurity(Document inPDFDoc, java.lang.String alias)
          Returns an unsecured PDF document given a certificate-encrypted PDF document.
 Document removePDFPasswordSecurity(Document inPDFDoc, java.lang.String password)
          Returns an unsecured PDF document given a password-encrypted PDF document and the permission password value that is required to remove encryption from a PDF document.
 Document removePDFSecurity(Document inPDFDoc)
          Returns a PDF document that has security removed given a PDF document that is secured using a password or APS credentials.
 Document unlockPDFUsingCredential(Document inPDFDoc, java.lang.String alias)
          Returns an unlocked PDF document given a certificate-encrypted PDF document as input.
 Document unlockPDFUsingPassword(Document inPDFDoc, java.lang.String password)
          Returns an unlocked PDF document given a password-encrypted PDF document as input.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptionServiceClient

public EncryptionServiceClient(ServiceClientFactory serviceClientFactory)
A constructor that creates an EncryptionServiceClient object.

Parameters:
serviceClientFactory - A com.adobe.idp.dsc.clientsdk.ServiceClientFactory that contains connection properties.
Method Detail

encryptPDFUsingPassword

public Document encryptPDFUsingPassword(Document inPDFDoc,
                                        PasswordEncryptionOptionSpec options)
                                 throws java.lang.Exception
Returns a password-encrypted PDF document. It is valid to pass a null value for the open password value. In this situation, the user is not prompted for the open password value when opening the PDF document in Adobe Reader or Acrobat. However, the user is prompted for the permission password value when they attempt to change settings in Acrobat or when removing encryption from the PDF document.

Likewise, you can specify null for the permission password. In this situation, the user is prompted for the open password value when opening the PDF document in Adobe Reader or Acrobat. However, the user is not prompted for the permission password value when they attempt to change settings in Acrobat or when removing encryption from the PDF document.

To see this method used in a code example, see the Encrypting a PDF document using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents the PDF document to encrypt.
options - A PasswordEncryptionSpec object that specifies encryption settings.
Returns:
A Document object that represents a password-encrypted PDF document.
Throws:
java.lang.Exception

unlockPDFUsingPassword

public Document unlockPDFUsingPassword(Document inPDFDoc,
                                       java.lang.String password)
                                throws java.lang.Exception
Returns an unlocked PDF document given a password-encrypted PDF document as input. A password-encrypted PDF document must be unlocked in order for other LiveCycle ES service operations to be performed on it.

To see this method used in a code example, see the Unlocking an encrypted PDF document using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents a password-encrypted PDF document to unlock.
password - A password value that is used to unlock a password-encrypted PDF document.
Returns:
A Document object that represents an unlocked PDF document.
Throws:
java.lang.Exception

removePDFPasswordSecurity

public Document removePDFPasswordSecurity(Document inPDFDoc,
                                          java.lang.String password)
                                   throws java.lang.Exception
Returns an unsecured PDF document given a password-encrypted PDF document and the permission password value that is required to remove encryption from a PDF document. After password-based encryption is removed from a PDF document, it is no longer secure. You cannot use the open password value to remove encryption from a PDF document.

To see this method used in a code example, see the Removing password-based encryption using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents a password-encrypted PDF document.
password - The permission password that is used to remove password-based encryption from a PDF document.
Returns:
A Document object that represents an unsecured PDF document.
Throws:
java.lang.Exception

removePDFSecurity

public Document removePDFSecurity(Document inPDFDoc)
                           throws java.lang.Exception
Returns a PDF document that has security removed given a PDF document that is secured using a password or APS credentials. This method is provided for backwards compatability with LiveCycle 7.

Parameters:
inPDFDoc - A PDF document that is unlocked using a password or APS credentials.
Returns:
A Document object that represents an unsecured PDF document.
Throws:
java.lang.Exception - If an error occurred during this operation. For example, if inPDFDoc is not an secured PDF document.

getPDFEncryption

public EncryptionTypeResult getPDFEncryption(Document inPDFDoc)
                                      throws java.lang.Exception
Returns an EncryptionTypeResult value that specifies the type of security that is used to secure the PDF document.

To see this method used in a code example, see the Determining encryption type using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents a secured PDF document.
Returns:
An EncryptionTypeResult object that specifies the type of security used to secure a PDF document.
Throws:
java.lang.Exception

encryptPDFUsingCertificates

public Document encryptPDFUsingCertificates(Document inPDFDoc,
                                            java.util.List pkiIdentities,
                                            CertificateEncryptionOptionSpec optionSpec)
                                     throws java.lang.Exception
Returns a certificate-encrypted PDF document. A valid certificate must be referenced in order to successfully encrypted a PDF document.

To see this method in a code example, see the Encrypting a PDF document with a certificate using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents the PDF document to encrypt.
pkiIdentities - A java.util.List object that contains certificate and permission information.
optionSpec - A CertificateEncryptionOptionSpec object that specifies encryption settings.
Returns:
A Document object that represents a certificate-encrypted PDF document.
Throws:
java.lang.Exception - If the PDF document is already encrypted or the certificate is invalid.

unlockPDFUsingCredential

public Document unlockPDFUsingCredential(Document inPDFDoc,
                                         java.lang.String alias)
                                  throws java.lang.Exception
Returns an unlocked PDF document given a certificate-encrypted PDF document as input. A secured PDF document must be unlocked in order for LiveCycle service operations to be performed on it.

Parameters:
inPDFDoc - A Document object that represents a certificate-encrypted PDF document to unlock.
alias - The alias that corresponds to the key that is used to unlock a secured PDF document.
Returns:
A Document object that represents an unlocked PDF document.
Throws:
java.lang.Exception - If the PDF document is not encrypted.

removePDFCertificateSecurity

public Document removePDFCertificateSecurity(Document inPDFDoc,
                                             java.lang.String alias)
                                      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.

To see this method in a code example, see the Removing certificate-based encryption using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
inPDFDoc - A Document object that represents the certificate-encrypted PDF document.
alias - The alias that corresponds to the key that is used to remove certificate-based encryption from the PDF document.
Returns:
A Document object that represents an unsecured PDF document.
Throws:
java.lang.Exception - If the PDF document is not encrypted or if the alias value is invalid.

decryptXML

public Document decryptXML(Document inXMLDoc,
                           java.util.Set aliases)
                    throws EncryptionServiceException
Returns a decrypted xml document decrypted with the set of private keys referred to by the Truststore Credential Aliases.

Parameters:
inXMLDoc - A Document object representing the input encrypted XML document.
aliases - A Set of strings representing aliases of the credentials in LiveCycle Truststore
Throws:
EncryptionServiceException

encryptXML

public Document encryptXML(Document inXMLDoc,
                           java.util.Set encRecps,
                           EncryptionAlgorithm encAlg,
                           java.lang.Boolean isXFA)
                    throws EncryptionServiceException
Returns an encrypted xml document encrypted for recipients represented by encRecps using the encryption algorithm encAlg

Parameters:
inXMLDoc - A Document object representing the input XML document.
encRecps - A set of XMLEncryptionIdentity representing the recipients along with xml sections to encrypt for them.
encAlg - com.adobe.livecycle.encryption.client.EncryptionAlgorithm identifying the encryption algorithm to use.
isXFA - (@java.lang.Boolean} signalling if the input XML belongs to the XFA family. This is used to output some XFA specific encryption properties in the returned document.
Throws:
EncryptionServiceException


[an error occurred while processing this directive] [an error occurred while processing this directive]