Class PublicKeySecurityHandler

java.lang.Object
org.sejda.sambox.pdmodel.encryption.SecurityHandler
org.sejda.sambox.pdmodel.encryption.PublicKeySecurityHandler

public final class PublicKeySecurityHandler extends SecurityHandler
This class implements the public key security handler described in the PDF specification.
See Also:
  • Field Details

  • Constructor Details

    • PublicKeySecurityHandler

      public PublicKeySecurityHandler()
      Constructor.
    • PublicKeySecurityHandler

      public PublicKeySecurityHandler(PublicKeyProtectionPolicy p)
      Constructor used for encryption.
      Parameters:
      p - The protection policy.
  • Method Details

    • prepareForDecryption

      public void prepareForDecryption(PDEncryption encryption, COSArray documentIDArray, DecryptionMaterial decryptionMaterial) throws 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:
      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.
    • appendCertInfo

      private void appendCertInfo(StringBuilder extraInfo, org.bouncycastle.cms.KeyTransRecipientId ktRid, X509Certificate certificate, org.bouncycastle.cert.X509CertificateHolder materialCert)