encode

fun encode(algorithm: SkAlgorithm, rawKey: ByteArray, application: String): ByteArray(source)

Build the SK public-key wire blob.

Parameters

algorithm

SK algorithm.

rawKey

For SkAlgorithm.ED25519 the 32-byte raw Ed25519 public key. For SkAlgorithm.ECDSA_P256 the 65-byte uncompressed SEC1 point (0x04 || X(32) || Y(32)).

application

Relying-party identifier (e.g. "ssh:").

Throws

if rawKey has the wrong size for the algorithm, or if the ECDSA point is malformed.