SessionEncryption
Helper class for implementing session encryption according to ISO/IEC 18013-5:2021 section 9.1.1 Session encryption.
The DeviceEngagement
and Handover
CBOR referenced in the parameters below must conform to the CDDL in ISO 18013-5.
All references to a "remote" device refer to a device with the opposite role. For example, SessionEncryption objects with the MdocRole.MDOC role will encrypt messages with the remote mdoc reader as the intended receiver, so the reader is the remote device.
Parameters
the role that the object should act as.
The ephemeral private key e.g. in the MdocRole.MDOC_READER role, it's the ephemeral private key for the mdoc reader, and in the MdocRole.MDOC role it's the for the mdoc.
The public ephemeral key of the other end.
The bytes of the SessionTranscript
CBOR.
Constructors
Properties
Functions
Decrypts a message received from the remote device.
Encrypt a message intended for the remote device.
Configure whether to send SessionEstablishment
as the first message. Only an object with the role MdocRole.MDOC_READER will want to do this.