public class EncryptedPrivateKey extends Object
An EncryptedPrivateKey contains the information produced after encrypting the private key bytes of an ECKey.
It contains two member variables - initialisationVector and encryptedPrivateBytes. The initialisationVector is a randomly chosen list of bytes that were used to initialise the AES block cipher when the private key bytes were encrypted. You need these for decryption. The encryptedPrivateBytes are the result of AES encrypting the private keys using an AES key that is derived from a user entered password. You need the password to recreate the AES key in order to decrypt these bytes.
Constructor and Description |
---|
EncryptedPrivateKey(byte[] initialisationVector,
byte[] encryptedPrivateKeys) |
EncryptedPrivateKey(EncryptedPrivateKey encryptedPrivateKey)
Cloning constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the EncryptedPrivateKey contents from memory (overwriting all data including PRIVATE KEYS).
|
EncryptedPrivateKey |
clone() |
boolean |
equals(Object obj) |
byte[] |
getEncryptedBytes() |
byte[] |
getInitialisationVector() |
int |
hashCode() |
void |
setEncryptedPrivateBytes(byte[] encryptedPrivateBytes)
Set the encrypted private key bytes, cloning them.
|
void |
setInitialisationVector(byte[] initialisationVector)
Set the initialisationVector, cloning the bytes.
|
String |
toString() |
public EncryptedPrivateKey(EncryptedPrivateKey encryptedPrivateKey)
encryptedPrivateKey
- EncryptedPrivateKey to clone.public EncryptedPrivateKey(byte[] initialisationVector, byte[] encryptedPrivateKeys)
iv
- encryptedPrivateKeys
- public byte[] getInitialisationVector()
public void setInitialisationVector(byte[] initialisationVector)
initialisationVector
- public byte[] getEncryptedBytes()
public void setEncryptedPrivateBytes(byte[] encryptedPrivateBytes)
encryptedPrivateBytes
- public EncryptedPrivateKey clone()
public void clear()
Copyright © 2014. All rights reserved.