create

fun create(keyManager: KeyManager, options: CreateDidKeyOptions? = null): BearerDid

Creates a new "did:key" DID, derived from a public key, and stores the associated private key in the provided KeyManager.

The method-specific identifier of a "did:key" DID is a multibase encoded public key.

Note: Defaults to ES256K if no options are provided

Return

A DidKey instance representing the newly created "did:key" DID.

Parameters

keyManager

A KeyManager instance where the new key will be stored.

options

Optional parameters (CreateDidKeyOptions) to specify algorithmId during key creation.

Throws

if the specified curve is not supported.