Enum BouncyCastleEncryptedPrivateKeyInfoDecryptor
java.lang.Object
java.lang.Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
org.apache.sshd.common.util.security.bouncycastle.BouncyCastleEncryptedPrivateKeyInfoDecryptor
- All Implemented Interfaces:
Serializable
,Comparable<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
,java.lang.constant.Constable
,Decryptor
public enum BouncyCastleEncryptedPrivateKeyInfoDecryptor
extends Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
implements Decryptor
Utility to decrypt an RFC 5958 PKCS#8 EncryptedPrivateKeyInfo.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] encrypted, char[] password) Decrypts encrypted bytes, using the given password as decryption key.Returns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Constructor Details
-
BouncyCastleEncryptedPrivateKeyInfoDecryptor
private BouncyCastleEncryptedPrivateKeyInfoDecryptor()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
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.- Specified by:
decrypt
in interfaceDecryptor
- Parameters:
encrypted
- data to decryptpassword
- decryption key- Returns:
- decrypted data, possibly
null
if decryption failed - Throws:
GeneralSecurityException
- may be thrown if decryption failed
-