Class PublicKeySecurityHandler

    • Field Detail

    • Constructor Detail

      • PublicKeySecurityHandler

        public PublicKeySecurityHandler()
        Constructor.
      • PublicKeySecurityHandler

        public PublicKeySecurityHandler​(PublicKeyProtectionPolicy publicKeyProtectionPolicy)
        Constructor used for encryption.
        Parameters:
        publicKeyProtectionPolicy - The protection policy.
    • Method Detail

      • prepareForDecryption

        public void prepareForDecryption​(PDEncryption encryption,
                                         COSArray documentIDArray,
                                         DecryptionMaterial decryptionMaterial)
                                  throws java.io.IOException
        Prepares everything to decrypt the document.
        Specified by:
        prepareForDecryption in class SecurityHandler
        Parameters:
        encryption - encryption dictionary, can be retrieved via PDDocument.getEncryption()
        documentIDArray - document id which is returned via COSDocument.getDocumentID() (not used by this handler)
        decryptionMaterial - Information used to decrypt the document.
        Throws:
        java.io.IOException - If there is an error accessing data. If verbose mode is enabled, the exception message will provide more details why the match wasn't successful.
      • prepareDocumentForEncryption

        public void prepareDocumentForEncryption​(PDDocument doc)
                                          throws java.io.IOException
        Prepare the document for encryption.
        Specified by:
        prepareDocumentForEncryption in class SecurityHandler
        Parameters:
        doc - The document that will be encrypted.
        Throws:
        java.io.IOException - If there is an error while encrypting.