getKeyId

suspend fun getKeyId(did: Did): Result<String>

Get the ID of the key to sign credentials with (issue assertions) for did.

Selection, in order:

  1. the first assertionMethod reference — the relationship W3C VC Data Integrity requires of an issuer's key;

  2. otherwise the first authentication reference;

  3. otherwise the first embedded verification method that is not reserved for keyAgreement (an encryption key such as X25519 cannot sign).

Previously the first embedded verification method was returned regardless of its relationships, which picked a key-agreement or authentication-only key for documents that list one first.

Return

Result wrapping the key ID string, or a failure with a descriptive message

Parameters

did

The DID to extract the key ID from