Sdílet prostřednictvím


ResultData.GetMessageAuthenticationCode Method

Definition

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.

[Android.Runtime.Register("getMessageAuthenticationCode", "()[B", "GetGetMessageAuthenticationCodeHandler", ApiSince=30)]
public abstract byte[]? GetMessageAuthenticationCode ();
[<Android.Runtime.Register("getMessageAuthenticationCode", "()[B", "GetGetMessageAuthenticationCodeHandler", ApiSince=30)>]
abstract member GetMessageAuthenticationCode : unit -> byte[]

Returns

Byte[]

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

Attributes

Remarks

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 IdentityCredential#getEntries(byte[], Map, byte[], byte[]) was null or the reader ephmeral public key was never set using IdentityCredential#setReaderEphemeralPublicKey(PublicKey), no message authencation code will be produced and this method will return null.

Java documentation for android.security.identity.ResultData.getMessageAuthenticationCode().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to