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
the cipher suite to use, for example Hpke.CipherSuite.DHKEM_P256_HKDF_SHA256_HKDF_SHA256_AES_128_GCM.
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.