Documentation ¶
Index ¶
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 { // See `created` in https://www.w3.org/TR/did-core/#did-document-metadata Created string `json:"created,omitempty" validate:"omitempty,datetime=2006-01-02T15:04:05Z"` // See `updated` in https://www.w3.org/TR/did-core/#did-document-metadata Updated string `json:"updated,omitempty" validate:"omitempty,datetime=2006-01-02T15:04:05Z"` // See `deactivated` in https://www.w3.org/TR/did-core/#did-document-metadata Deactivated bool `json:"deactivated,omitempty"` // See `nextUpdate` in https://www.w3.org/TR/did-core/#did-document-metadata NextUpdate string `json:"nextUpdate,omitempty"` // See `versionId` in https://www.w3.org/TR/did-core/#did-document-metadata VersionID string `json:"versionId,omitempty"` // See `nextVersionId` in https://www.w3.org/TR/did-core/#did-document-metadata NextVersionID string `json:"nextVersionId,omitempty"` // See `equivalentId` in https://www.w3.org/TR/did-core/#did-document-metadata EquivalentID []string `json:"equivalentId,omitempty"` // See `canonicalId` in https://www.w3.org/TR/did-core/#did-document-metadata CanonicalID string `json:"canonicalId,omitempty"` // Optional information that is specific to the DID Method of the DID Document resolved. Populated only // for sidetree based did methods (e.g. ION), as described in https://identity.foundation/sidetree/spec/#did-resolver-output Method Method `json:"method,omitempty"` }
DocumentMetadata https://www.w3.org/TR/did-core/#did-document-metadata
func (*DocumentMetadata) IsValid ¶
func (s *DocumentMetadata) IsValid() bool
type Error ¶
type Error struct { Code string `json:"code"` InvalidDID bool `json:"invalidDid"` NotFound bool `json:"notFound"` RepresentationNotSupported bool `json:"representationNotSupported"` }
Error https://www.w3.org/TR/did-core/#did-resolution-metadata
type Metadata ¶
type Metadata struct { ContentType string `json:"contentType,omitempty"` Error *Error `json:"error,omitempty"` }
Metadata https://www.w3.org/TR/did-core/#did-resolution-metadata
type Method ¶
type Method struct { // The `method` property in https://identity.foundation/sidetree/spec/#did-resolver-output Published bool `json:"published"` // The `recoveryCommitment` property in https://identity.foundation/sidetree/spec/#did-resolver-output RecoveryCommitment string `json:"recoveryCommitment,omitempty"` // The `updateCommitment` property in https://identity.foundation/sidetree/spec/#did-resolver-output UpdateCommitment string `json:"updateCommitment,omitempty"` }
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
type Option ¶
type Option any
Option https://www.w3.org/TR/did-spec-registries/#did-resolution-options
type Resolver ¶
type Resolver interface { // Resolve Attempts to resolve a DID for a given method Resolve(ctx context.Context, id string, opts ...Option) (*Result, 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
type Result ¶
type Result struct { Context string `json:"@context,omitempty"` Metadata `json:"didResolutionMetadata"` did.Document `json:"didDocument,omitempty"` *DocumentMetadata `json:"didDocumentMetadata,omitempty"` }
Result encapsulates the tuple of a DID resolution https://www.w3.org/TR/did-core/#did-resolution
func ParseDIDResolution ¶
ParseDIDResolution attempts to parse a DID Resolution Result or a DID Document