T - the concrete type of this encryptor object.public abstract class AbstractEncryptor<T extends AbstractEncryptor<T>> extends Object implements EncryptorInterface<T>
| Constructor and Description |
|---|
AbstractEncryptor() |
| 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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCharsetpublic void initialize()
throws GeneralSecurityException
initialize in interface EncryptorInterface<T extends AbstractEncryptor<T>>GeneralSecurityException - GeneralSecurityExceptionpublic byte[] encrypt(byte[] bytes)
throws GeneralSecurityException
encrypt in interface EncryptorInterface<T extends AbstractEncryptor<T>>bytes - the byte array to be encryptedGeneralSecurityException - GeneralSecurityExceptionpublic byte[] encrypt(byte[] bytes,
Key encKey)
throws GeneralSecurityException
Key.encrypt in interface EncryptorInterface<T extends AbstractEncryptor<T>>bytes - the byte array to be encryptedencKey - the encryption keyGeneralSecurityException - GeneralSecurityExceptionpublic byte[] decrypt(byte[] bytes)
throws GeneralSecurityException
decrypt in interface EncryptorInterface<T extends AbstractEncryptor<T>>bytes - the byte array to be decryptedGeneralSecurityException - GeneralSecurityExceptionpublic byte[] decrypt(byte[] bytes,
Key decKey)
throws GeneralSecurityException
Key.decrypt in interface EncryptorInterface<T extends AbstractEncryptor<T>>bytes - the byte array to be decrypteddecKey - the decryption keyGeneralSecurityException - GeneralSecurityExceptionpublic boolean isInitialized()
isInitialized in interface EncryptorInterface<T extends AbstractEncryptor<T>>public T setAlgorithmParameters(AlgorithmParameters<?> parameters)
setAlgorithmParameters in interface EncryptorInterface<T extends AbstractEncryptor<T>>parameters - the algorithm parameterspublic AlgorithmParameters<?> getAlgorithmParameters()
getAlgorithmParameters in interface EncryptorInterface<T extends AbstractEncryptor<T>>