sign

fun sign(did: BearerDid, assertionMethodId: String? = null): String

Sign a verifiable credential using a specified decentralized identifier (did) with the private key that pairs with the public key identified by assertionMethodId.

If the assertionMethodId is null, the function will attempt to use the first available verification method from the did. The result is a String in a JWT format.

Return

The JWT representing the signed verifiable credential.

Example:

val signedVc = verifiableCredential.sign(myDid)

Parameters

did

The BearerDid used to sign the credential.

assertionMethodId

An optional identifier for the assertion method that will be used for verification of the produced signature.