@ApiAudience.Private @ApiStability.Unstable public class EncryptedPrivateKeyResolver extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CHAR_SET |
Constructor and Description |
---|
EncryptedPrivateKeyResolver() |
Modifier and Type | Method and Description |
---|---|
protected static byte[] |
calculateNonce(byte[] hashedPassword) |
static BytesValue |
decrypt(EncryptedPrivateKey encryptedPrivateKey,
java.lang.String password)
Decrypt encrypted private key with a
password . |
static EncryptedPrivateKey |
encrypt(BytesValue privateKeyBytes,
java.lang.String password)
Encrypt private key with a
password . |
protected static final java.lang.String CHAR_SET
public static EncryptedPrivateKey encrypt(BytesValue privateKeyBytes, java.lang.String password) throws org.bouncycastle.crypto.InvalidCipherTextException, java.io.UnsupportedEncodingException
password
.privateKeyBytes
- a raw private keypassword
- a password to encryptorg.bouncycastle.crypto.InvalidCipherTextException
- on encryption failurejava.io.UnsupportedEncodingException
- on password encoding failurepublic static BytesValue decrypt(EncryptedPrivateKey encryptedPrivateKey, java.lang.String password) throws org.bouncycastle.crypto.InvalidCipherTextException, java.io.UnsupportedEncodingException
password
.encryptedPrivateKey
- an encrypted private keypassword
- a password to decryptorg.bouncycastle.crypto.InvalidCipherTextException
- on decryption failurejava.io.UnsupportedEncodingException
- on password encoding failureprotected static byte[] calculateNonce(byte[] hashedPassword)