Documentation
¶
Index ¶
Constants ¶
const ( // InvalidDIDErr indicates: "The DID supplied to the DID resolution function does not conform to valid syntax. (See § 3.1 DID Syntax.)" InvalidDIDErr = constError("supplied DID is invalid") // NotFoundErr indicates: "The DID resolver was unable to find the DID document resulting from this resolution request." NotFoundErr = constError("supplied DID wasn't found") // DeactivatedErr indicates: The DID supplied to the DID resolution function has been deactivated. (See § 7.2.4 Deactivate .) DeactivatedErr = constError("supplied DID is deactivated") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DID ¶
DID represents a Decentralized Identifier as specified by the DID Core specification (https://www.w3.org/TR/did-core/#identifier).
func (DID) MarshalJSON ¶
MarshalJSON marshals the DID to a JSON string
func (*DID) UnmarshalJSON ¶
UnmarshalJSON unmarshals a DID encoded as JSON string, e.g.: "did:nuts:c0dc584345da8a0e1e7a584aa4a36c30ebdb79d907aff96fe0e90ee972f58a17"
type Document ¶
type Document struct {
Context []URI `json:"@context"`
ID DID `json:"id"`
Controller []DID `json:"controller,omitempty"`
VerificationMethod []VerificationMethod `json:"verificationMethod,omitempty"`
Authentication []VerificationRelationship `json:"authentication,omitempty"`
AssertionMethod []VerificationRelationship `json:"assertionMethod,omitempty"`
Service []Service `json:"service,omitempty"`
}
Document represents a DID Document as specified by the DID Core specification (https://www.w3.org/TR/did-core/).
func (*Document) UnmarshalJSON ¶
type DocumentMetadata ¶
type DocumentMetadata struct {
Created *time.Time
Updated *time.Time
Properties map[string]interface{}
}
DocumentMedata represents DID Document Metadata as specified by the DID Core specification (https://www.w3.org/TR/did-core/#did-document-metadata-properties).
type Resolver ¶
type Resolver interface {
// Resolve tries to resolve the given input DID to its DID Document and Metadata. In addition to errors specific
// to this resolver it can return InvalidDIDErr, NotFoundErr and DeactivatedErr as specified by the DID Core specification.
// If no error occurs the DID Document and Medata are returned.
Resolve(inputDID string) (*Document, *DocumentMetadata, error)
}
Resolver defines the interface for DID resolution as specified by the DID Core specification (https://www.w3.org/TR/did-core/#did-resolution).
type Service ¶
Service represents a DID Service Endpoint as specified by the DID Core specification (https://www.w3.org/TR/did-core/#service-endpoints).
type VerificationMethod ¶
type VerificationMethod struct {
ID DID
Type string
Controller DID
PublicKeyJwk map[string]interface{}
// contains filtered or unexported fields
}
VerificationMethod represents a DID Verification Method as specified by the DID Core specification (https://www.w3.org/TR/did-core/#verification-methods).
func (VerificationMethod) JWK ¶
func (v VerificationMethod) JWK() jwk.Key
JWK returns the key described by the VerificationMethod as JSON Web Key.
func (*VerificationMethod) UnmarshalJSON ¶
func (v *VerificationMethod) UnmarshalJSON(bytes []byte) error
type VerificationRelationship ¶
type VerificationRelationship struct {
*VerificationMethod
// contains filtered or unexported fields
}
VerificationRelationship represents the usage of a VerificationMethod e.g. in authentication, assertionMethod, or keyAgreement.
func (*VerificationRelationship) UnmarshalJSON ¶
func (v *VerificationRelationship) UnmarshalJSON(b []byte) error