Enum BouncyCastleEncryptedPrivateKeyInfoDecryptor
- java.lang.Object
-
- java.lang.Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
-
- org.apache.sshd.common.util.security.bouncycastle.BouncyCastleEncryptedPrivateKeyInfoDecryptor
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
,Decryptor
public enum BouncyCastleEncryptedPrivateKeyInfoDecryptor extends java.lang.Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor> implements Decryptor
Utility to decrypt an RFC 5958 PKCS#8 EncryptedPrivateKeyInfo.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
BouncyCastleEncryptedPrivateKeyInfoDecryptor()
-
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 BouncyCastleEncryptedPrivateKeyInfoDecryptor
valueOf(java.lang.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(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 namejava.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 aGeneralSecurityException
.The caller is responsible for eventually clearing the
password
and the decrypted data returned.
-
-