sign

suspend fun sign(key: EcPrivateKey, signatureAlgorithm: Algorithm, claimsSet: JsonObject, type: String?, x5c: X509CertChain?): String

Deprecated

Use org.multipaz.jwt.buildJwt instead

Sign a claims set.

Use org.multipaz.webtoken.buildJwt instead.

Return

the compact serialization with the JWS.

Parameters

key

the key to sign with.

signatureAlgorithm

a fully-specified signature algorithm to use.

claimsSet

the claims set.

type

the value to put in the "typ" header parameter or null.

x5c

the certificate chain to put in the "x5c" header parameter or null.

Throws

if the signature algorithm is not fully specified.

if key has been destroyed.


suspend fun sign(secureArea: SecureArea, alias: String, unlockReason: Reason, claimsSet: JsonObject, type: String?, x5c: X509CertChain?): String

Deprecated

Use org.multipaz.jwt.buildJwt instead

Sign a claims set using a SecureArea.

Use org.multipaz.webtoken.buildJwt instead.

Return

the compact serialization of the JWS.

Parameters

secureArea

the SecureArea for the key to sign with.

alias

the alias for key to sign with.

unlockReason

the reason for unlocking.

claimsSet

the claims set.

type

the value to put in the "typ" header parameter or null.

x5c

the certificate chain to put in the "x5c" header parameter or null.

Throws

if no key with the given alias exists or algorithm is incompatible.

if the key needs unlocking.

if the key is no longer usable.