Versions in this module Expand all Collapse all v0 v0.3.1 Mar 10, 2022 Changes in this version type Document + AlsoKnownAs []string + func (d *Document) AddAlias(alias string) v0.0.3 Mar 1, 2022 Changes in this version + const MAX_BASE_PART_LENGTH + const MIN_BASE_PART_LENGTH + const SONR_PREFIX + var DidForbiddenSymbolsRegexp = regexp.Compile(`^[^&\\]+$`) + var ErrBaseNotFound = errors.New("Unable to determine base did of provided string.") + var ErrFragmentAndQuery = errors.New("Unable to create new DID. Fragment and Query are mutually exclusive") + var ErrParseInvalid = errors.New("Unable to parse string into DID, invalid format.") + func Complement(vs []string, ts []string) []string + func Contains(vs []string, t string) bool + func ContainsFragment(didUrl string) bool + func ContainsModule(didUrl string) bool + func ContainsPath(didUrl string) bool + func ContainsQuery(didUrl string) bool + func ContainsString(s string, t string) bool + func ExtractBase(did string) (bool, string) + func ExtractFragment(didUrl string) (bool, string) + func ExtractIdentifier(did string) (bool, string) + func ExtractPath(didUrl string) (bool, string) + func ExtractQuery(didUrl string) (bool, string) + func Filter(vs []string, f func(string) bool) []string + func IndexOf(vs []string, t string) int + func IsFragment(didUrl string) bool + func IsPath(didUrl string) bool + func IsQuery(didUrl string) bool + func IsValidDid(did string) bool + func ToFragment(str string) string + func ToIdentifier(str string) string + func ToNetwork(str string) string + func ToQuery(str string) string + type DidUrl string + func Build(identifier string, opts ...Option) (DidUrl, error) + func (d DidUrl) String() string + type Option func(*config) + func WithFragment(fragment string) Option + func WithNetwork(network string) Option + func WithPathSegments(p ...string) Option + func WithQuery(query string) Option v0.0.2 Mar 1, 2022 v0.0.1 Feb 28, 2022 Changes in this version + const DIDContextV1 + const DeactivatedErr + const InvalidDIDErr + const NotFoundErr + var ErrDIDDocumentInvalid = validationError + var ErrInvalidAssertionMethod = errors.New("invalid assertionMethod") + var ErrInvalidAuthentication = errors.New("invalid authentication") + var ErrInvalidCapabilityDelegation = errors.New("invalid capabilityDelegation") + var ErrInvalidCapabilityInvocation = errors.New("invalid capabilityInvocation") + var ErrInvalidContext = errors.New("invalid context") + var ErrInvalidController = errors.New("invalid controller") + var ErrInvalidDID = ParserError + var ErrInvalidID = errors.New("invalid ID") + var ErrInvalidKeyAgreement = errors.New("invalid keyAgreement") + var ErrInvalidService = errors.New("invalid service") + var ErrInvalidVerificationMethod = errors.New("invalid verificationMethod") + func DIDContextV1URI() ssi.URI + type DID struct + func MustParseDID(input string) DID + func MustParseDIDURL(input string) DID + func ParseDID(input string) (*DID, error) + func ParseDIDURL(input string) (*DID, error) + func (d *DID) UnmarshalJSON(bytes []byte) error + func (d DID) Empty() bool + func (d DID) Equals(other DID) bool + func (d DID) MarshalJSON() ([]byte, error) + func (d DID) MarshalText() ([]byte, error) + func (d DID) String() string + func (d DID) URI() ssi.URI + type Document struct + AssertionMethod VerificationRelationships + Authentication VerificationRelationships + CapabilityDelegation VerificationRelationships + CapabilityInvocation VerificationRelationships + Context []ssi.URI + Controller []DID + ID DID + KeyAgreement VerificationRelationships + Service []Service + VerificationMethod VerificationMethods + func (d *Document) AddAssertionMethod(v *VerificationMethod) + func (d *Document) AddAuthenticationMethod(v *VerificationMethod) + func (d *Document) AddCapabilityDelegation(v *VerificationMethod) + func (d *Document) AddCapabilityInvocation(v *VerificationMethod) + func (d *Document) AddKeyAgreement(v *VerificationMethod) + func (d *Document) ResolveEndpointURL(serviceType string) (endpointID ssi.URI, endpointURL string, err error) + func (d *Document) UnmarshalJSON(b []byte) error + func (d Document) IsController(controller DID) bool + func (d Document) MarshalJSON() ([]byte, error) + type DocumentMetadata struct + Created *time.Time + Properties map[string]interface{} + Updated *time.Time + type MultiValidator struct + Validators []Validator + func (m MultiValidator) Validate(document Document) error + type ParserError struct + func (w ParserError) Error() string + func (w ParserError) Is(other error) bool + func (w ParserError) Unwrap() error + type Resolver interface + Resolve func(inputDID string) (*Document, *DocumentMetadata, error) + type Service struct + ID ssi.URI + ServiceEndpoint interface{} + Type string + func (s *Service) UnmarshalJSON(data []byte) error + func (s Service) MarshalJSON() ([]byte, error) + func (s Service) UnmarshalServiceEndpoint(target interface{}) error + type Validator interface + Validate func(document Document) error + type VerificationMethod struct + Controller DID + ID DID + PublicKeyBase58 string + PublicKeyJwk map[string]interface{} + Type ssi.KeyType + func NewVerificationMethod(id DID, keyType ssi.KeyType, controller DID, key crypto.PublicKey) (*VerificationMethod, error) + func (v *VerificationMethod) UnmarshalJSON(bytes []byte) error + func (v VerificationMethod) JWK() (jwk.Key, error) + func (v VerificationMethod) PublicKey() (crypto.PublicKey, error) + type VerificationMethods []*VerificationMethod + func (vms *VerificationMethods) Add(v *VerificationMethod) + func (vms *VerificationMethods) Remove(id DID) *VerificationMethod + func (vms VerificationMethods) FindByID(id DID) *VerificationMethod + type VerificationRelationship struct + func (v *VerificationRelationship) UnmarshalJSON(b []byte) error + func (v VerificationRelationship) MarshalJSON() ([]byte, error) + type VerificationRelationships []VerificationRelationship + func (vmr *VerificationRelationships) Add(vm *VerificationMethod) + func (vmr *VerificationRelationships) Remove(id DID) *VerificationRelationship + func (vmr VerificationRelationships) FindByID(id DID) *VerificationMethod + type W3CSpecValidator struct + func (w W3CSpecValidator) Validate(document Document) error