Udostępnij za pośrednictwem


CredentialDataResult.GetDeviceMac Method

Definition

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

[Android.Runtime.Register("getDeviceMac", "()[B", "GetGetDeviceMacHandler", ApiSince=33)]
public abstract byte[]? GetDeviceMac ();
[<Android.Runtime.Register("getDeviceMac", "()[B", "GetGetDeviceMacHandler", ApiSince=33)>]
abstract member GetDeviceMac : 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 #getDeviceNameSpaces(), 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 session transcript or reader ephemeral key wasn't set on the PresentationSession used to obtain this data no message authencation code will be produced and this method will return null.

Java documentation for android.security.identity.CredentialDataResult.getDeviceMac().

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