verifyAssertion

abstract fun verifyAssertion(validatedAttestation: ValidatedAttestation, assertion: ByteArray, expectedChallenge: ByteArray, validCounters: LongRange): Result<Assertion>(source)

Verifies a fresh assertion, tied to a previously stored attestation. This function assumes that clientDataHash is the SHA-256 digest of expectedChallenge.

The attestation is not verified again! There is no timeliness guarantee of any kind, so manually verify the freshness of the challenge before calling this function

A Note on Counters:
AppAttest only checks whether the signature counter BEFORE SIGNING AN ASSERTION is higher than a provided value. That is, a value of 0 will always work. Warden Supreme also allows checking for a maximum, hence validCounters. If you don't care for it, just pass Long.MAX_VALUE as upper bound (inclusive).
Also note that the upper bound will also be calculated on the value BEFORE creating the assertion!

Parameters

validatedAttestation

the previously validated attestation

expectedChallenge

the expected client data to be contained in assertion

validCounters

The range of valid counters


abstract fun verifyAssertion(validatedAttestation: ValidatedAttestation, assertion: ByteArray, referenceClientData: ByteArray, validCounters: LongRange, expectedChallenge: ByteArray, validator: AssertionChallengeValidator): Result<Assertion>(source)

Verifies a fresh assertion, tied to a previously stored attestation.

The attestation is not verified again! There is no timeliness guarantee of any kind, so manually verify the freshness of the challenge before calling this function

A Note on Counters:
AppAttest only checks whether the signature counter is higher than a provided value. That is, a value of 0 will always work. Warden Supreme also allows checking for a maximum, hence validCounters. If you don't care for it, just pass Long.MAX_VALUE as upper bound (inclusive).
Also note that the upper bound will also be calculated on the value BEFORE creating the assertion!

Parameters

validatedAttestation

the previously validated attestation

validCounters

The range of valid counters

validator

a fresh AssertionChallengeValidator that checks for challenge, clientData, etc.


open fun verifyAssertion(attestationObject: ByteArray, assertionFromDevice: ByteArray, referenceClientData: ByteArray, challenge: ByteArray, counter: Long = 0): AttestationResult(source)

Deprecated (with error)

Misnomer, counter is ignored

Replace with

verifyCombined(attestationObject, assertionFromDevice, referenceClientData, challenge)