CoseKey

@Serializable(with = CoseKeySerializer::class)
data class CoseKey(val type: CoseKeyType, val keyId: ByteArray? = null, val algorithm: CoseAlgorithm? = null, val operations: Array<CoseKeyOperation>? = null, val baseIv: ByteArray? = null, val keyParams: CoseKeyParams?) : SpecializedCryptoPublicKey(source)

COSE public key as per RFC 8152. Since this is used as part of a COSE-specific DTO, every property is nullable

Deserializing involves guess-work since the COSE specification uses overlapping CborLabels for compressed and uncompressed EC keys and generally overlapping labels for various params regardless of key type.

RFC 8152 really is a marvel in its own right: Rarely a spec comes a long that highlights the harder bounds of any natural language quite like it, as written forms of human communication lack the fluid semantics required to truly capture the unique challenges of parsing COSE keys and the lack of any redeeming qualities of the design decisions embodied by RFC 8152.

See serialize and deserialize for details.

Constructors

Link copied to clipboard
constructor(type: CoseKeyType, keyId: ByteArray? = null, algorithm: CoseAlgorithm? = null, operations: Array<CoseKeyOperation>? = null, baseIv: ByteArray? = null, keyParams: CoseKeyParams?)

Types

Link copied to clipboard
object Companion

Contains convenience functions

Properties

Link copied to clipboard
Link copied to clipboard
val baseIv: ByteArray? = null
Link copied to clipboard
val keyId: ByteArray? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
open override fun toCryptoPublicKey(): KmmResult<CryptoPublicKey>
Link copied to clipboard
open override fun toString(): String