Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(domain string, opts ...CreateOption) (_did.BearerDID, error)
Create creates a new 'did:web' BearerDID with the given domain and options provided. If no options are provided, a default key manager will be used to generate a single ED25519 key pair. The resulting public key will be added to the DID Document as a VerificationMethod. More information regarding did:web can be found here: https://w3c-ccg.github.io/did-method-web/
Types ¶
type CreateOption ¶
type CreateOption func(*createOptions)
CreateOption is the type returned from each individual option function
func AlsoKnownAs ¶
func AlsoKnownAs(aka ...string) CreateOption
AlsoKnownAs is used to set the 'alsoKnownAs' property of the DID Document. more details here: https://www.w3.org/TR/did-core/#also-known-as
func Controllers ¶
func Controllers(controllers ...string) CreateOption
Controllers is used to set the 'controller' property of the DID Document. more details here: https://www.w3.org/TR/did-core/#controller
func KeyManager ¶
func KeyManager(km crypto.KeyManager) CreateOption
KeyManager is used to set the key manager that will be used to generate the private keys for the DID.
func PrivateKey ¶
func PrivateKey(algorithmID string, purposes ...didcore.Purpose) CreateOption
PrivateKey is used to add a private key to the DID being created with the Create function. Each PrivateKey provided will be used to generate a private key in the key manager and then added to the DID Document as a VerificationMethod.
type Resolver ¶
type Resolver struct{}
Resolver is a type to implement resolution
func (Resolver) Resolve ¶
func (r Resolver) Resolve(uri string) (didcore.ResolutionResult, error)
Resolve the provided DID URI (must be a did:web) as per the spec
func (Resolver) ResolveWithContext ¶
func (r Resolver) ResolveWithContext(ctx context.Context, uri string) (didcore.ResolutionResult, error)
ResolveWithContext the provided DID URI (must be a did:web) as per the spec