sign

abstract fun sign(privateKey: Jwk, payload: ByteArray, options: SignOptions? = null): ByteArray

Sign a given payload using a private key.

This function takes a payload and a private key in Jwk (JSON Web Key) format, and returns a signature as a byte array. Additional options for the signing process can be provided via the options parameter.

Return

A ByteArray representing the signature.

Parameters

privateKey

The private key in Jwk format to be used for signing. Must not be null.

payload

The payload/data to be signed. Must not be null.

options

Optional parameter containing additional options to control the signing process. Default is null.