Package-level declarations

Types

Link copied to clipboard
@Serializable
data class AttestationChallenge

Represents a challenge for attestation processes, encapsulating necessary details such as the nonce, validity, and additional constraints or metadata for the attestation proof.

Link copied to clipboard
@Serializable
sealed class AttestationResponse
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
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

Properties

Link copied to clipboard
val TbsCertificationRequest.challenge: KmmResult<ByteArray>
Link copied to clipboard
val Pkcs10CertificationRequest.deviceName: String?
val TbsCertificationRequest.deviceName: String?
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

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

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 CertificateChain.withAndroidAttestationExtensions(): List<X509Certificate>

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