sign

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

Sign a verifiable presentation using a specified decentralized identifier (bearerDid) 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 bearerDid. The result is a String in a JWT format.

Return

The JWT representing the signed verifiable credential.

Example:

val signedVp = verifiablePresentation.sign(myDid)

Parameters

bearerDid

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.