Class PBEDataDecryptorFactory

    • Constructor Detail

      • PBEDataDecryptorFactory

        protected PBEDataDecryptorFactory​(char[] passPhrase,
                                          PGPDigestCalculatorProvider calculatorProvider)
        Construct a PBE data decryptor factory.
        Parameters:
        passPhrase - the pass phrase to generate decryption keys with.
        calculatorProvider - the digest to use in key generation.
    • Method Detail

      • makeKeyFromPassPhrase

        public byte[] makeKeyFromPassPhrase​(int keyAlgorithm,
                                            S2K s2k)
                                     throws PGPException
        Generates an encryption key using the pass phrase and digest calculator configured for this factory.
        Parameters:
        keyAlgorithm - the encryption algorithm to generate a key for.
        s2k - the string-to-key specification to use to generate the key.
        Returns:
        the key bytes for the encryption algorithm, generated using the pass phrase of this factory.
        Throws:
        PGPException - if an error occurs generating the key.
      • recoverSessionData

        public abstract byte[] recoverSessionData​(int keyAlgorithm,
                                                  byte[] key,
                                                  byte[] seckKeyData)
                                           throws PGPException
        Decrypts session data from an encrypted data packet.
        Parameters:
        keyAlgorithm - the encryption algorithm used to encrypt the session data.
        key - the key bytes for the encryption algorithm.
        seckKeyData - the encrypted session data to decrypt.
        Returns:
        the decrypted session data.
        Throws:
        PGPException - if an error occurs decrypting the session data.