Enum BouncyCastleEncryptedPrivateKeyInfoDecryptor

    • Constructor Detail

      • BouncyCastleEncryptedPrivateKeyInfoDecryptor

        private BouncyCastleEncryptedPrivateKeyInfoDecryptor()
    • Method Detail

      • values

        public static BouncyCastleEncryptedPrivateKeyInfoDecryptor[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BouncyCastleEncryptedPrivateKeyInfoDecryptor c : BouncyCastleEncryptedPrivateKeyInfoDecryptor.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BouncyCastleEncryptedPrivateKeyInfoDecryptor valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • decrypt

        public byte[] decrypt​(byte[] encrypted,
                              char[] password)
                       throws java.security.GeneralSecurityException
        Description copied from interface: Decryptor
        Decrypts encrypted bytes, using the given password as decryption key.

        The encrypted data must contain enough information about the encryption algorithm used so that it can be decrypted at all.

        If the password is wrong, the method may return wrongly decrypted data. If decryption fails, it may return null or throw a GeneralSecurityException.

        The caller is responsible for eventually clearing the password and the decrypted data returned.

        Specified by:
        decrypt in interface Decryptor
        Parameters:
        encrypted - data to decrypt
        password - decryption key
        Returns:
        decrypted data, possibly null if decryption failed
        Throws:
        java.security.GeneralSecurityException - may be thrown if decryption failed