Documentation ¶
Index ¶
- func GetMethodForDID(id string) (did.Method, error)
- func ResolveKeyForDID(ctx context.Context, resolver Resolver, id, kid string) (gocrypto.PublicKey, error)
- type DocumentMetadata
- type MultiMethodResolver
- type ResolutionError
- type ResolutionMetadata
- type ResolutionOption
- type ResolutionResult
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMethodForDID ¶
GetMethodForDID provides the method for the given did string
Types ¶
type DocumentMetadata ¶
type DocumentMetadata struct { Created string `json:"created,omitempty" validate:"datetime"` Updated string `json:"updated,omitempty" validate:"datetime"` Deactivated bool `json:"deactivated,omitempty"` NextUpdate string `json:"nextUpdate,omitempty"` VersionID string `json:"versionId,omitempty"` NextVersionID string `json:"nextVersionId,omitempty"` EquivalentID string `json:"equivalentId,omitempty"` CanonicalID string `json:"canonicalId,omitempty"` }
DocumentMetadata https://www.w3.org/TR/did-core/#did-document-metadata
func (*DocumentMetadata) IsValid ¶
func (s *DocumentMetadata) IsValid() bool
type MultiMethodResolver ¶
type MultiMethodResolver struct {
// contains filtered or unexported fields
}
MultiMethodResolver resolves a DID. The current implementation ssk-sdk does not have a universal resolution: https://github.com/decentralized-identity/universal-resolver In its place, this method attempts to resolve DID methods that can be resolved without relying on additional services.
func NewResolver ¶
func NewResolver(resolvers ...Resolver) (*MultiMethodResolver, error)
func (MultiMethodResolver) Methods ¶
func (dr MultiMethodResolver) Methods() []did.Method
func (MultiMethodResolver) Resolve ¶
func (dr MultiMethodResolver) Resolve(ctx context.Context, id string, opts ...ResolutionOption) (*ResolutionResult, error)
Resolve attempts to resolve a DID for a given method
type ResolutionError ¶
type ResolutionError struct { Code string `json:"code"` InvalidDID bool `json:"invalidDid"` NotFound bool `json:"notFound"` RepresentationNotSupported bool `json:"representationNotSupported"` }
ResolutionError https://www.w3.org/TR/did-core/#did-resolution-metadata
type ResolutionMetadata ¶
type ResolutionMetadata struct { ContentType string Error *ResolutionError }
ResolutionMetadata https://www.w3.org/TR/did-core/#did-resolution-metadata
type ResolutionOption ¶
type ResolutionOption any
ResolutionOption https://www.w3.org/TR/did-spec-registries/#did-resolution-options
type ResolutionResult ¶
type ResolutionResult struct { Context string `json:"@context,omitempty"` ResolutionMetadata `json:"didResolutionMetadata,omitempty"` did.Document `json:"didDocument,omitempty"` DocumentMetadata `json:"didDocumentMetadata,omitempty"` }
ResolutionResult encapsulates the tuple of a DID resolution https://www.w3.org/TR/did-core/#did-resolution
func ParseDIDResolution ¶
func ParseDIDResolution(resolvedDID []byte) (*ResolutionResult, error)
ParseDIDResolution attempts to parse a DID Resolution Result or a DID Document
func (*ResolutionResult) IsEmpty ¶
func (r *ResolutionResult) IsEmpty() bool
type Resolver ¶
type Resolver interface { // Resolve Attempts to resolve a DID for a given method Resolve(ctx context.Context, id string, opts ...ResolutionOption) (*ResolutionResult, error) // Methods returns all methods that can be resolved by this resolution. Methods() []did.Method }
Resolver provides an interface for resolving DIDs as per the spec https://www.w3.org/TR/did-core/#did-resolution