-
public interface DataEnvelopeThis object is responsible for decoding encrypted responses when refreshing the Identity. The type of encryption used as well as the format of the expected data can be found in the following documentation:
See Also:GitHub
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDataEnvelope.Default
-
Method Summary
Modifier and Type Method Description abstract ByteArrayencrypt(SecretKey key, String data, ByteArray iv, ByteArray aad)Encrypts the given data with the provided key. abstract ByteArraydecrypt(String key, String data, Boolean includesNonce)Decrypts the given data with the provided key. abstract ByteArraydecrypt(ByteArray key, String data, Boolean includesNonce)Decrypts the given data with the provided key. -
-
Method Detail
-
encrypt
abstract ByteArray encrypt(SecretKey key, String data, ByteArray iv, ByteArray aad)
Encrypts the given data with the provided key.
- Parameters:
key- The key, as represented by a SecretKey, required to encrypt the given data.data- The data to encrypt.iv- The initialization vector.aad- Any additional authentication data.
-
decrypt
abstract ByteArray decrypt(String key, String data, Boolean includesNonce)
Decrypts the given data with the provided key.
This relies on the format of the data matching that spec-ed in the API documentation. We assume that it's AES encrypted, and includes the IV in the first 12 bytes of the buffer.
- Parameters:
key- The key, in Base64 format, required to decode the given data.data- The data, in Base64 format, that needs to be decoded.includesNonce- If a nonce (and timestamp) is expected in the decrypted data.
-
decrypt
abstract ByteArray decrypt(ByteArray key, String data, Boolean includesNonce)
Decrypts the given data with the provided key.
This relies on the format of the data matching that spec-ed in the API documentation. We assume that it's AES encrypted, and includes the IV in the first 12 bytes of the buffer.
- Parameters:
key- The key, in bytes, required to decode the given data.data- The data, in Base64 format, that needs to be decoded.includesNonce- If a nonce (and timestamp) is expected in the decrypted data.
-
-
-
-