IdentityCredential.ProveOwnership(Byte[]) Method

Definition

Proves ownership of a credential.

[Android.Runtime.Register("proveOwnership", "([B)[B", "GetProveOwnership_arrayBHandler", ApiSince=31)]
public virtual byte[] ProveOwnership (byte[] challenge);
[<Android.Runtime.Register("proveOwnership", "([B)[B", "GetProveOwnership_arrayBHandler", ApiSince=31)>]
abstract member ProveOwnership : byte[] -> byte[]
override this.ProveOwnership : byte[] -> byte[]

Parameters

challenge
Byte[]

is a non-empty byte array whose contents should be unique, fresh and provided by the issuing authority. The value provided is embedded in the generated CBOR and enables the issuing authority to verify that the returned proof is fresh. Implementations are required to support challenges at least 32 bytes of length.

Returns

Byte[]

the COSE_Sign1 data structure above

Attributes

Remarks

Proves ownership of a credential.

This method returns a COSE_Sign1 data structure signed by the CredentialKey with payload set to ProofOfDeletion as defined below.

The returned CBOR is the following:

ProofOfOwnership = [
                     "ProofOfOwnership",           ; tstr
                     tstr,                         ; DocType
                     bstr,                         ; Challenge
                     bool                          ; true if this is a test credential, should
                                                   ; always be false.
                 ]

This is only implemented in feature version 202101 or later. If not implemented, the call fails with UnsupportedOperationException. See android.content.pm.PackageManager#FEATURE_IDENTITY_CREDENTIAL_HARDWARE for known feature versions.

Java documentation for android.security.identity.IdentityCredential.proveOwnership(byte[]).

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