getDecrypter
suspend fun getDecrypter(cipherSuite: Hpke.CipherSuite, receiverPrivateKey: AsymmetricKey, encapsulatedKey: ByteArray, info: ByteArray, psk: ByteArray? = null, pskId: ByteArray? = null, authKey: EcPublicKey? = null): Hpke.Decrypter
Creates a Decrypter object for HPKE for the given cipherSuite.
Return
a Decrypter object which can be used to decrypt messages from the sender.
Parameters
cipherSuite
the cipher suite to use, for example Hpke.CipherSuite.DHKEM_P256_HKDF_SHA256_HKDF_SHA256_AES_128_GCM.
receiverPrivateKey
an AsymmetricKey for the key the data is encrypted against, must be compatible with the curve in cipherSuite and must support key agreement.
encapsulatedKey
the encapsulated key, received from the sender.
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.