T - the concrete type of this Encryptor object.public interface EncryptorInterface<T extends EncryptorInterface<T>>
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] bytes)
Decrypts the byte array.
|
byte[] |
decrypt(byte[] bytes,
Key decKey)
Decrypts the byte array using the given
Key. |
byte[] |
encrypt(byte[] bytes)
Encrypts the byte array.
|
byte[] |
encrypt(byte[] bytes,
Key encKey)
Encrypts the byte array using the given
Key. |
AlgorithmParameters<?> |
getAlgorithmParameters()
Gets the algorithm parameters used for initialization.
|
Charset |
getCharset()
Returns the charset used by the encryptor.
|
void |
initialize()
Initializes the encryptor.
|
boolean |
isInitialized()
Indicates whether or not the encryptor has been initialized.
|
T |
setAlgorithmParameters(AlgorithmParameters<?> parameters)
Sets the algorithm parameters used for initialization.
|
void initialize()
throws GeneralSecurityException
GeneralSecurityException - GeneralSecurityExceptionbyte[] encrypt(byte[] bytes)
throws GeneralSecurityException
bytes - the byte array to be encryptedGeneralSecurityException - GeneralSecurityExceptionbyte[] encrypt(byte[] bytes,
Key encKey)
throws GeneralSecurityException
Key.bytes - the byte array to be encryptedencKey - the encryption keyGeneralSecurityException - GeneralSecurityExceptionbyte[] decrypt(byte[] bytes)
throws GeneralSecurityException
bytes - the byte array to be decryptedGeneralSecurityException - GeneralSecurityExceptionbyte[] decrypt(byte[] bytes,
Key decKey)
throws GeneralSecurityException
Key.bytes - the byte array to be decrypteddecKey - the decryption keyGeneralSecurityException - GeneralSecurityExceptionT setAlgorithmParameters(AlgorithmParameters<?> parameters)
parameters - the algorithm parametersAlgorithmParameters<?> getAlgorithmParameters()
boolean isInitialized()
Charset getCharset()