Added in API level 28

AttestedKeyPair

class AttestedKeyPair
kotlin.Any
   ↳ android.security.AttestedKeyPair

The AttestedKeyPair class contains a KeyPair instance of keys generated by Keystore and owned by KeyChain, as well as an attestation record for the key.

Such keys can be obtained by calling android.app.admin.DevicePolicyManager#generateKeyPair.

Summary

Public constructors
AttestedKeyPair(keyPair: KeyPair?, attestationRecord: MutableList<Certificate!>)

Public constructor for creating a new instance (useful for testing).

Public methods
MutableList<Certificate!>

Returns the attestation record for the key pair in this instance.

KeyPair?

Returns the generated key pair associated with the attestation record in this instance.

Public constructors

AttestedKeyPair

Added in API level 28
AttestedKeyPair(
    keyPair: KeyPair?,
    attestationRecord: MutableList<Certificate!>)

Public constructor for creating a new instance (useful for testing).

Parameters
keyPair KeyPair?: the key pair associated with the attestation record. This value may be null.
attestationRecord MutableList<Certificate!>: attestation record for the provided key pair. This value cannot be null.

Public methods

getAttestationRecord

Added in API level 28
fun getAttestationRecord(): MutableList<Certificate!>

Returns the attestation record for the key pair in this instance. The attestation record is a chain of certificates. The leaf certificate links to the public key of this key pair and other properties of the key or the device. If the key is in secure hardware, and if the secure hardware supports attestation, the leaf certificate will be signed by a chain of certificates rooted at a trustworthy CA key. Otherwise the chain will be rooted at an untrusted certificate. The attestation record could be for properties of the key, or include device identifiers. See android.security.keystore.KeyGenParameterSpec.Builder#setAttestationChallenge and Key Attestation for the format of the attestation record inside the certificate.

Return
MutableList<Certificate!> This value cannot be null.

getKeyPair

Added in API level 28
fun getKeyPair(): KeyPair?

Returns the generated key pair associated with the attestation record in this instance.

Return
KeyPair? This value may be null.