|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PasswordCiphertext
Ciphertext represents a single password encrypted data. It can be serialized and deserialized and the same password will be able to decrypt it.
| Method Summary | |
|---|---|
byte[] |
decrypt(java.lang.String password)
Get the message (i.e. |
int |
getRequiredKeySize()
Get the length of the key which should be output by the keyFunction which is to be passed to init(byte[], String, KeyDerivationFunction). |
void |
init(byte[] message,
java.lang.String password,
KeyDerivationFunction initializedKeyFunction)
Initialize this ciphertext with a given message (i.e. |
byte[] |
serialize()
Serialize this ciphertext into a byte array which can later be deserialized and the text decrypted from that. |
| Method Detail |
|---|
void init(byte[] message,
java.lang.String password,
KeyDerivationFunction initializedKeyFunction)
throws java.security.GeneralSecurityException
decrypt(String) with the same password.
message - the message which will be encrypted.password - the password used to encrypt the message.initializedKeyFunction - an initialized KeyDerivationFunction which will return a key of the length given
by getRequiredKeySize().
java.security.GeneralSecurityException - if something goes wrong while encrypting.
byte[] decrypt(java.lang.String password)
throws java.security.GeneralSecurityException
password - the user supplied password.
java.security.GeneralSecurityException - if something goes wrong while decrypting.
byte[] serialize()
throws java.io.IOException
java.io.IOException - if something goes wrong in the serialization framework.int getRequiredKeySize()
init(byte[], String, KeyDerivationFunction).
Users are expected to call this method and pass the result when initializing the key derivation function then
pass the initialized key derivation function to init(byte[], String, KeyDerivationFunction).
getRequiredKeySize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||