androidAttestationExtension
Tries to parse an AttestationKeyDescription certificate extension, if present. Never throws.
Tries to parse an AttestationKeyDescription certificate extension, if present. Never throws.
As per Google's parser: Parse the attestation record that is closest to the root. This prevents an adversary from attesting an attestation record of their choice with an otherwise trusted chain using the following attack:
having the TEE attest a key under the adversary's control,
using that key to sign a new leaf certificate with an attestation extension that has their chosen attestation record, then
appending that certificate to the original certificate chain.
Return
the AttestationKeyDescription closest to the root or null if non is present