Documentation ¶
Index ¶
- Constants
- type DIDWeb
- func (d DIDWeb) CreateDoc(kt crypto.KeyType, publicKey []byte) (*did.Document, error)
- func (d DIDWeb) CreateDocBytes(kt crypto.KeyType, publicKey []byte) ([]byte, error)
- func (d DIDWeb) GetDocURL() (string, error)
- func (DIDWeb) Method() did.Method
- func (d DIDWeb) Resolve(ctx context.Context) (*did.Document, error)
- func (d DIDWeb) String() string
- func (d DIDWeb) Suffix() (string, error)
- func (d DIDWeb) Validate(ctx context.Context) error
- type Resolver
Constants ¶
const ( WellKnownURLPath = ".well-known/" DIDDocFilename = "did.json" Prefix = "did:web" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DIDWeb ¶
type DIDWeb string
did:web method specification https://w3c-ccg.github.io/did-method-web/ DID Web create and resolve methods are implemented in this package but NOT the update and deactivate methods please refer to web_test.go for example and test cases
func (DIDWeb) CreateDoc ¶
CreateDoc constructs a did:web Document from a specific key type and its corresponding public key. This method does not attempt to validate that the provided public key is of the specified key type. The returned Document is expected further turned into a JSON file named did.json and stored under the expected path of the target web domain specification: https://w3c-ccg.github.io/did-method-web/#create-register
func (DIDWeb) CreateDocBytes ¶
CreateDocBytes simply takes the output from CreateDoc and returns the bytes of the JSON DID document
type Resolver ¶
type Resolver struct{}
func (Resolver) Resolve ¶
func (Resolver) Resolve(ctx context.Context, id string, _ ...resolution.Option) (*resolution.Result, error)
Resolve fetches and returns the Document from the expected URL specification: https://w3c-ccg.github.io/did-method-web/#read-resolve