toCoseKey
fun SymmetricKey<*, *, *>.toCoseKey( baseIv: ByteArray? = null, keyId: ByteArray? = this.coseKid, vararg includedOps: CoseKeyOperation): KmmResult<CoseKey>(source)
Creates a CoseKey matching, if the key's SymmetricKey.algorithm has a COSE mapping.
fun CryptoPublicKey.toCoseKey(algorithm: CoseAlgorithm.Signature? = null, keyId: ByteArray? = this.coseKid): KmmResult<CoseKey>(source)
Converts CryptoPublicKey into a KmmResult wrapped CoseKey If algorithm is not set then key can be used for any algorithm with same kty (RFC 8152), returns IllegalArgumentException for invalid kty/algorithm pairs