sign

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

Signs a payload using a private key.

This function utilizes the appropriate Signer to generate a digital signature of the provided payload using the provided private key.

Return

The digital signature as a byte array.

Parameters

privateKey

The Jwk private key to be used for generating the signature.

payload

The byte array data to be signed.

options

Options for the signing operation, may include specific parameters relevant to the algorithm.