|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.jasypt.util.binary.BasicBinaryEncryptor
public final class BasicBinaryEncryptor
Utility class for easily performing normal-strength encryption of binaries (byte arrays).
This class internally holds a StandardPBEByteEncryptor
configured this way:
The required steps to use it are:
setPassword(String)
or
setPasswordCharArray(char[])
).encrypt(byte[])
or
decrypt(byte[])
operations.This class is thread-safe.
Constructor Summary | |
---|---|
BasicBinaryEncryptor()
Creates a new instance of BasicBinaryEncryptor. |
Method Summary | |
---|---|
byte[] |
decrypt(byte[] encryptedBinary)
Decrypts a byte array. |
byte[] |
encrypt(byte[] binary)
Encrypts a byte array |
void |
setPassword(String password)
Sets a password. |
void |
setPasswordCharArray(char[] password)
Sets a password, as a char[]. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicBinaryEncryptor()
Method Detail |
---|
public void setPassword(String password)
password
- the password to be set.public void setPasswordCharArray(char[] password)
password
- the password to be set.public byte[] encrypt(byte[] binary)
encrypt
in interface BinaryEncryptor
binary
- the byte array to be encrypted.StandardPBEByteEncryptor.encrypt(byte[])
public byte[] decrypt(byte[] encryptedBinary)
decrypt
in interface BinaryEncryptor
encryptedBinary
- the byte array to be decrypted.StandardPBEByteEncryptor.decrypt(byte[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |