@UESComponent public interface CryptographyService
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] data,
Decrypt data.
|
byte[] |
encrypt(byte[] data,
Encrypt data.
|
javax.crypto.SecretKey |
generateKey()
Generates new cryptography key (strongest possible based on concrete cryptography algorithm configuration).
|
javax.crypto.SecretKey |
generateKey(char[] password, |
java.lang.String |
generateRandomSecret(int length)
Generates secure random sequence of characters.
|
java.lang.String |
getCipherAlgorithm() |
java.lang.String |
getHashAlgorithm() |
java.lang.String |
getKeyAlgorithm() |
java.lang.String |
getPasswordBasedKeyAlgorithm() |
java.lang.String |
getSecureRandomAlgorithm() |
byte[] |
hash(byte[] data,
Creates hash of given data.
|
data
- Data to encrypt. Data cannot be null.key
- Encryption keyCryptographyServiceRTException
- In case encryption failsdata
- Data to decrypt. Data cannot be null.key
- Decryption keyCryptographyServiceRTException
- In case decryption failsdata
- Data to be hashed. Data cannot be null.key
- Hashing keyCryptographyServiceRTException
- In case generating of hash failsCryptographyRTException
- In case generating of key failspassword
- Password for generator.salt
- The salt for generator.CryptographyRTException
for more informations.
CryptographyService.generateRandomSecret(int)
.CryptographyService.getSecureRandomAlgorithm()
is
used internally by this method.length
- - the length of generated secret.