- All Superinterfaces:
JWA
A JWA cipher is used to encrypt and decrypt content.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn encrypted data composed of the initialization vector, the authentication tag and the cipher text. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] cipherText, byte[] aad, byte[] iv, byte[] tag) Decrypts the specified cypher text.default JWACipher.EncryptedDataencrypt(byte[] data, byte[] aad) Encrypts the specified data using a defaultSecureRandom.encrypt(byte[] data, byte[] aad, SecureRandom secureRandom) Encrypts the specified data using the specifiedSecureRandom.Methods inherited from interface io.inverno.mod.security.jose.jwa.JWA
getProcessedParameters
-
Method Details
-
encrypt
Encrypts the specified data using a default
SecureRandom.- Parameters:
data- the data to encryptaad- additional authentication data- Returns:
- encrypted data
- Throws:
JWACipherException- if there was an error encrypting the data
-
encrypt
JWACipher.EncryptedData encrypt(byte[] data, byte[] aad, SecureRandom secureRandom) throws JWACipherException Encrypts the specified data using the specified
SecureRandom.- Parameters:
data- the data to encryptaad- additional authentication datasecureRandom- a secure random- Returns:
- encrypted data
- Throws:
JWACipherException- if there was an error encrypting the data
-
decrypt
Decrypts the specified cypher text.
- Parameters:
cipherText- the cipher text to decryptaad- the additional authentication dataiv- the initialization vectortag- the authentication tag- Returns:
- decrypted data
- Throws:
JWACipherException- if there was an error decrypting the data
-