Class PdfSigGenericPKCS

Direct Known Subclasses:
PdfSigGenericPKCS.PPKLite, PdfSigGenericPKCS.PPKMS, PdfSigGenericPKCS.VeriSign

public abstract class PdfSigGenericPKCS extends PdfSignature
A signature dictionary representation for the standard filters.
  • Field Details

    • hashAlgorithm

      protected String hashAlgorithm
      The hash algorithm, for example "SHA1"
    • provider

      protected String provider
      The crypto provider
    • pkcs

      protected PdfPKCS7 pkcs
      The class instance that calculates the PKCS#1 and PKCS#7
    • name

      protected String name
      The subject name in the signing certificate (the element "CN")
    • externalDigest

      private byte[] externalDigest
    • externalRSAdata

      private byte[] externalRSAdata
    • digestEncryptionAlgorithm

      private String digestEncryptionAlgorithm
  • Constructor Details

    • PdfSigGenericPKCS

      public PdfSigGenericPKCS(PdfName filter, PdfName subFilter)
      Creates a generic standard filter.
      Parameters:
      filter - the filter name
      subFilter - the sub-filter name
  • Method Details

    • setSignInfo

      public void setSignInfo(PrivateKey privKey, Certificate[] certChain, CRL[] crlList)
      Sets the crypto information to sign.
      Parameters:
      privKey - the private key
      certChain - the certificate chain
      crlList - the certificate revocation list. It can be null
    • setExternalDigest

      public void setExternalDigest(byte[] digest, byte[] RSAdata, String digestEncryptionAlgorithm)
      Sets the digest/signature to an external calculated value.
      Parameters:
      digest - the digest. This is the actual signature
      RSAdata - the extra data that goes into the data tag in PKCS#7
      digestEncryptionAlgorithm - the encryption algorithm. It may must be null if the digest is also null. If the digest is not null then it may be "RSA" or "DSA"
    • getName

      public String getName()
      Gets the subject name in the signing certificate (the element "CN")
      Returns:
      the subject name in the signing certificate (the element "CN")
    • getSigner

      public PdfPKCS7 getSigner()
      Gets the class instance that does the actual signing.
      Returns:
      the class instance that does the actual signing
    • getSignerContents

      public byte[] getSignerContents()
      Gets the signature content. This can be a PKCS#1 or a PKCS#7. It corresponds to the /Contents key.
      Returns:
      the signature content