Enum BouncyCastleEncryptedPrivateKeyInfoDecryptor
- java.lang.Object
-
- java.lang.Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
-
- org.apache.sshd.common.util.security.bouncycastle.BouncyCastleEncryptedPrivateKeyInfoDecryptor
-
- All Implemented Interfaces:
Serializable,Comparable<BouncyCastleEncryptedPrivateKeyInfoDecryptor>,Decryptor
public enum BouncyCastleEncryptedPrivateKeyInfoDecryptor extends Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor> implements Decryptor
Utility to decrypt an RFC 5958 PKCS#8 EncryptedPrivateKeyInfo.- Author:
- Apache MINA SSHD Project
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] encrypted, char[] password)Decrypts encrypted bytes, using the given password as decryption key.static BouncyCastleEncryptedPrivateKeyInfoDecryptorvalueOf(String name)Returns the enum constant of this type with the specified name.static BouncyCastleEncryptedPrivateKeyInfoDecryptor[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final BouncyCastleEncryptedPrivateKeyInfoDecryptor INSTANCE
-
-
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(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
decrypt
public byte[] decrypt(byte[] encrypted, char[] password) throws GeneralSecurityExceptionDescription copied from interface:DecryptorDecrypts 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
nullor throw aGeneralSecurityException.The caller is responsible for eventually clearing the
passwordand the decrypted data returned.- Specified by:
decryptin interfaceDecryptor- Parameters:
encrypted- data to decryptpassword- decryption key- Returns:
- decrypted data, possibly
nullif decryption failed - Throws:
GeneralSecurityException- may be thrown if decryption failed
-
-