Top Description Fields Constructors Methods
org.apache.sshd.common.util.security.bouncycastle

public final Enum BouncyCastleEncryptedPrivateKeyInfoDecryptor

extends Enum<BouncyCastleEncryptedPrivateKeyInfoDecryptor>
implements Decryptor
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.util.security.Decryptor
Imports
java.io.IOException, java.security.GeneralSecurityException, .NoSuchProviderException, org.apache.sshd.common.util.security.Decryptor, .SecurityProviderRegistrar, .SecurityUtils, org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo, .PKCSException, org.bouncycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder

Utility to decrypt an RFC 5958 PKCS#8 EncryptedPrivateKeyInfo.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final BouncyCastleEncryptedPrivateKeyInfoDecryptor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public byte[]
decrypt(byte[]
data to decrypt
encrypted
,
char[]
decryption key
password
)

Implements org.apache.sshd.common.util.security.Decryptor.decrypt.

Decrypts encrypted bytes, using the given password as decryption key.

public static BouncyCastleEncryptedPrivateKeyInfoDecryptor
public static BouncyCastleEncryptedPrivateKeyInfoDecryptor[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final BouncyCastleEncryptedPrivateKeyInfoDecryptor INSTANCE

Constructor Detail

BouncyCastleEncryptedPrivateKeyInfoDecryptorback to summary
private BouncyCastleEncryptedPrivateKeyInfoDecryptor()

Method Detail

decryptback to summary
public byte[] decrypt(byte[] encrypted, char[] password) throws GeneralSecurityException

Implements org.apache.sshd.common.util.security.Decryptor.decrypt.

Doc from org.apache.sshd.common.util.security.Decryptor.decrypt.

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.

Parameters
encrypted:byte[]

data to decrypt

password:char[]

decryption key

Returns:byte[]

decrypted data, possibly null if decryption failed

Annotations
@Override
Exceptions
GeneralSecurityException:
may be thrown if decryption failed
valueOfback to summary
public static BouncyCastleEncryptedPrivateKeyInfoDecryptor valueOf(String name)
valuesback to summary
public static BouncyCastleEncryptedPrivateKeyInfoDecryptor[] values()