publicKeyToBytes

fun publicKeyToBytes(publicKey: Jwk): ByteArray

Converts a Jwk public key into its byte array representation.

Return

A ByteArray representing the byte-level information of the provided public key.

Example

val publicKeyBytes = publicKeyToBytes(myJwkPublicKey)

Note

This function assumes that the provided Jwk contains valid curve and algorithm information. Malformed or invalid Jwk objects may result in exceptions or unexpected behavior.

Throws

Parameters

publicKey

A Jwk object representing the public key to be converted.