getEncrypter

suspend fun getEncrypter(cipherSuite: Hpke.CipherSuite, receiverPublicKey: EcPublicKey, info: ByteArray, psk: ByteArray? = null, pskId: ByteArray? = null, authKey: AsymmetricKey? = null): Hpke.Encrypter

Creates a Encrypter object for HPKE in for the given cipherSuite.

Return

a Encrypter object which can be used to encrypt messages to the receiver.

Parameters

cipherSuite
receiverPublicKey

the public key to encrypt the data against, must be compatible with cipherSuite.

info

data which can be used to influence the generation of keys (e.g., to fold in identity information).

psk

pre-shared key to use or null.

pskId

the identifier for the optional pre-shared key, must be non-null exactly when psk is non-null.

authKey

optional authentication key or null.