SessionTransportTransformerEncrypt
class SessionTransportTransformerEncrypt(encryptionKeySpec: SecretKeySpec, signKeySpec: SecretKeySpec, ivGenerator: (size: Int) -> ByteArray, encryptAlgorithm: String, signAlgorithm: String) : SessionTransportTransformer
Content copied to clipboard
A transformer used to sign and encrypt/decrypt session data. This transformer works as follows:
encrypts/decrypts data using encryptAlgorithm and encryptionKeySpec
includes an authenticated MAC (Message Authentication Code) hash with signAlgorithm and signKeySpec
includes an IV (Initialization Vector) that is generated by an ivGenerator by default secure random bytes
By default, it uses AES for encryption and HmacSHA256 for authentication.
You have to provide keys of compatible sizes: 16, 24 and 32 for AES encryption. For HmacSHA256 it is recommended a key of 32 bytes.
See also
Constructors
Link copied to clipboard
Link copied to clipboard
fun SessionTransportTransformerEncrypt(encryptionKeySpec: SecretKeySpec, signKeySpec: SecretKeySpec, ivGenerator: (size: Int) -> ByteArray = { size -> ByteArray(size).apply { SecureRandom().nextBytes(this) } }, encryptAlgorithm: String = encryptionKeySpec.algorithm, signAlgorithm: String = signKeySpec.algorithm)
Content copied to clipboard
Types
Functions
Link copied to clipboard
Untransforms a transportValue that represents a transformed session.
Link copied to clipboard
Transforms a transportValue that represents session data.