getMessageAuthenticationCode

Returns a message authentication code over the DeviceAuthenticationBytes CBOR specified in getAuthenticatedData, to prove to the reader that the data is from a trusted credential.

The MAC proves to the reader that the data is from a trusted credential. This code is produced by using the key agreement and key derivation function from the ciphersuite with the authentication private key and the reader ephemeral public key to compute a shared message authentication code (MAC) key, then using the MAC function from the ciphersuite to compute a MAC of the authenticated data. See section 9.2.3.5 of ISO/IEC 18013-5 for details of this operation.

If the sessionTranscript parameter passed to getEntries was null or the reader ephmeral public key was never set using setReaderEphemeralPublicKey, no message authencation code will be produced and this method will return null. At most one of getMessageAuthenticationCode or getEcdsaSignature is implemented.

Return

A COSE_Mac0 structure with the message authentication code as described above or null if the conditions specified above are not met.