Documentation ¶
Index ¶
Constants ¶
const (
DIDFragementDelimiter = "#"
)
Variables ¶
var ( ErrUnsupportedDIDKey = errors.New("unsupported did key") // ErrNoVerificationMethodId occurs when a did verification method id is empty ErrNoVerificationMethodId = errors.New("did verification method id is not set") )
Functions ¶
func WithWebGetter ¶
func WithWebGetter(webGetter didWebGetter) didwebOption
WithWebGetter sets the web getter, that gets the did document from the web
Types ¶
type DIDPublicKeyProvider ¶
type DIDPublicKeyProvider struct {
// contains filtered or unexported fields
}
func NewDIDPublicKeyProvider ¶
func NewDIDPublicKeyProvider(cs *dtcose.CoseSign1Message, didWeb *Didweb) *DIDPublicKeyProvider
NewDIDPublicKeyProvider returns a provider which fetches a did web key To customize the key fetch (or for testing purposes), provide a non-nil didWeb. Otherwise one is created for you.
func (*DIDPublicKeyProvider) DidWeb ¶
func (p *DIDPublicKeyProvider) DidWeb() (*Didweb, error)
type Did ¶
type Did struct {
// contains filtered or unexported fields
}
did is a Decentralised Identity (DID) https://www.w3.org/TR/did-core/
type Didweb ¶
type Didweb struct { *Did // contains filtered or unexported fields }
didweb is the did web method implementation:
https://w3c-ccg.github.io/did-method-web/
type Document ¶
type Document struct { ID string `json:"id"` Context []string `json:"@context,omitempty"` Controller []string `json:"controller,omitempty"` VerificationMethod []VerificationMethod `json:"verificationMethod,omitempty"` }
Document represents a DID Document as specified by the DID Core specification (https://www.w3.org/TR/did-core/).
type ErrDiDKeyNotFound ¶
type ErrDiDKeyNotFound struct {
// contains filtered or unexported fields
}
ErrDiDKeyNotFound occurs when a did document does not contain the given key in the verification method list
func (*ErrDiDKeyNotFound) Error ¶
func (e *ErrDiDKeyNotFound) Error() string
Error implements the error interface
type ErrMalformedDIDId ¶
type ErrMalformedDIDId struct {
// contains filtered or unexported fields
}
ErrMalformedDIDId occurs when a did id is not in the expected format, expected format is host:{path} e.g. `example.com:path:to:resource`
func (*ErrMalformedDIDId) Error ¶
func (e *ErrMalformedDIDId) Error() string
Error implements the error interface
type ErrUnsupportedDIDMethod ¶
type ErrUnsupportedDIDMethod struct {
// contains filtered or unexported fields
}
ErrUnsupportedDIDMethod occurs when a did url has an unsupported method, e.g. `did:foobar`
func (*ErrUnsupportedDIDMethod) Error ¶
func (e *ErrUnsupportedDIDMethod) Error() string
Error implements the error interface
type VerificationMethod ¶
type VerificationMethod struct { ID string `json:"id"` Type string `json:"type,omitempty"` Controller string `json:"controller,omitempty"` PublicKeyBase58 string `json:"publicKeyBase58,omitempty"` PublicKeyJwk map[string]interface{} `json:"publicKeyJwk,omitempty"` }
VerificationMethod represents a DID Verification Method as specified by the DID Core specification (https://www.w3.org/TR/did-core/#verification-methods).