sign

expect suspend fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): EcSignature

Signs data with a key.

The signature is DER encoded except for curve Ed25519 and Ed448 where it's just the raw R and S values.

Return

the signature.

Parameters

key

the key to sign with.

signatureAlgorithm

the signature algorithm to use.

message

the data to sign.


expect suspend fun sign(key: RsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): RsaSignature

Signs data with an RSA key.

Return

the signature.

Parameters

key

the key to sign with.

signatureAlgorithm

the signature algorithm to use.

message

the data to sign.


expect suspend fun sign(key: MlDsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): MlDsaSignature

Signs data with an ML-DSA key.

Return

the signature.

Parameters

key

the key to sign with.

signatureAlgorithm

the signature algorithm to use.

message

the data to sign.

actual suspend fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): EcSignature
actual suspend fun sign(key: RsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): RsaSignature
actual suspend fun sign(key: MlDsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): MlDsaSignature
actual suspend fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): EcSignature

Signs data with a key.

Return

the signature.

Parameters

key

the key to sign with.

signatureAlgorithm

the signature algorithm to use.

message

the data to sign.


actual suspend fun sign(key: RsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): RsaSignature
actual suspend fun sign(key: MlDsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): MlDsaSignature
actual suspend fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): EcSignature
actual suspend fun sign(key: RsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): RsaSignature
actual suspend fun sign(key: MlDsaPrivateKey, signatureAlgorithm: Algorithm, message: ByteArray): MlDsaSignature