Package-level declarations

Types

Link copied to clipboard
@Serializable
data class AttestationChallenge

Represents a challenge for an attestation ceremony, including freshness, key-generation hints, the required DataAuthentication mode, and optional client-provided values that must be bound to the attestation.

Link copied to clipboard
data class AttestationHashInput : Asn1Encodable<Asn1Sequence>

Canonical DER structure authenticated by DataAuthentication.Hash.

Link copied to clipboard
sealed interface AttestationProof

An authenticated client-to-verifier transport carrying the platform-generated attestation statement.

Link copied to clipboard
@Serializable
sealed class AttestationResponse
Link copied to clipboard
class AttestedAttributes(val otherAttributesEncoded: Asn1Sequence?)

Additional client-provided values decoded from the sequence stored in a dedicated TBS CSR attribute.

Link copied to clipboard
object BitLengthSerializer : KSerializer<BitLength>
Link copied to clipboard
typealias Constrained = Any?

Constrained value type for AttestationChallenge.additionalPayload.

Link copied to clipboard

Format-agnostic serializer for Map<String, Constrained>.

Link copied to clipboard
sealed interface DataAuthentication

Selects how the client authenticates the data surrounding an attestation proof.

Link copied to clipboard
object DigestSerializer : KSerializer<Digest>
Link copied to clipboard
Link copied to clipboard
object ECCurveSerializer : KSerializer<ECCurve>
Link copied to clipboard
class InstantLongSerializer : KSerializer<Instant>
Link copied to clipboard
@Serializable
data class KeyConstraints(val algorithmParameters: KeyConstraints.AlgorithmParameters, val keyProtection: KeyConstraints.KeyProtection? = null)

Constraints on the key to be created on the client. If properly set, allows for ridiculously hands-free key and attestation statement creation

Link copied to clipboard
typealias Primitive = Any?

Primitive value type used for client-provided attested attributes.

Link copied to clipboard
@Serializable(with = PrimitiveType.ByteSerializer::class)
enum PrimitiveType : Enum<PrimitiveType>

Type discriminator and ASN.1 codec for Primitive values.

Link copied to clipboard
class SortedSet<E>(values: Collection<E>, comparator: Comparator<E>, hash: (E) -> Int = { it.hashCode() }) : Set<E>

A KMP-compatible immutable set backed by sorted values, never by attacker-controlled hashes.

Link copied to clipboard

Properties

Link copied to clipboard
const val MAX_JSON_NESTING_DEPTH: Int = 64

Max JSON container-nesting depth accepted before parsing.

Link copied to clipboard
val TbsCertificationRequest.nonce: KmmResult<ByteArray>

Tries to extract the nonce from a TBS CSR's subject name, given it is encoded into an RDN containing a KnownOIDs.serialNumber

Link copied to clipboard
val AttestationProof.tbsCsr: TbsCertificationRequest

Returns the unsigned certification-request information carried by either transport shape.

Functions

Link copied to clipboard
fun TbsCertificationRequest.attestationStatementForChallenge(challenge: AttestationChallenge): KmmResult<Attestation>

Tries to extract an attestation statement from a TBS CSR based on the proofOID specified in challenge

Link copied to clipboard
fun TbsCertificationRequest.attestationStatementForOid(oid: ObjectIdentifier): KmmResult<Attestation>

Tries to extract an attestation statement from a TBS CSR, given it is present as an attribute with oid

Link copied to clipboard
fun List<X509Certificate>.closestToRoot(predicate: (X509Certificate) -> Boolean): X509Certificate

Returns the certificate matching the predicate that is closest to the root. Can be the root itself.

Link copied to clipboard
fun List<X509Certificate>.closestToRootOrNull(predicate: (X509Certificate) -> Boolean): X509Certificate?

Returns the certificate matching the predicate that is closes to the root. Can be the root itself.

Link copied to clipboard
fun Pkcs10CertificationRequest.deviceNameForChallenge(challenge: AttestationChallenge): String?

fun TbsCertificationRequest.deviceNameForChallenge(challenge: AttestationChallenge): String?

Tries to extract a device name from a TBS CSR if genericDeviceNameOID is specified in challenge

Link copied to clipboard
fun Pkcs10CertificationRequest.deviceNameForOid(oid: ObjectIdentifier): String?

fun TbsCertificationRequest.deviceNameForOid(oid: ObjectIdentifier): String?

Tries to extract a device name from a TBS CSR, given it is present as an attribute with oid

Link copied to clipboard

Decodes these values using the ordered attribute description carried by challenge.

Link copied to clipboard

Scans json for excessive object or array nesting without parsing it. Brackets inside string literals (keys/values) are ignored. Throws SerializationException if depth exceeds MAX_JSON_NESTING_DEPTH. Cheap, single linear pass, no allocation.

Link copied to clipboard
fun TbsCertificationRequest.toHashInput(proofOid: ObjectIdentifier): AttestationHashInput

Removes the public key and exactly one attestation-proof attribute identified by proofOid, producing the canonical input used by DataAuthentication.Hash.

Link copied to clipboard
fun List<Primitive>.toSequence(): Asn1Sequence

Encodes only the additional attribute values, tagged by position, for storage in the TBS CSR.

Link copied to clipboard
fun CertificateChain.withAndroidAttestationExtensions(): List<X509Certificate>

Returns a list of certificates that contain an attestation extension; in-order.