Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
      View Source
      
  
const (
	// Context of the DID document
	Context = "https://w3id.org/did/v1"
)
    Variables ¶
      View Source
      
  var ErrKeyNotFound = errors.New("key not found")
    ErrKeyNotFound is returned when key is not found
      View Source
      
  var ErrProofNotFound = errors.New("proof not found")
    ErrProofNotFound is returned when proof is not found
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
	Context        []string
	ID             string
	PublicKey      []PublicKey
	Service        []Service
	Authentication []VerificationMethod
	Created        *time.Time
	Updated        *time.Time
	Proof          []Proof
}
    Doc DID Document definition
func ParseDocument ¶
ParseDocument creates an instance of DIDDocument by reading a JSON document from bytes
type DocOption ¶
type DocOption func(opts *Doc)
DocOption provides options to build DID Doc.
func WithAuthentication ¶
func WithAuthentication(auth []VerificationMethod) DocOption
WithAuthentication DID doc Authentication.
func WithCreatedTime ¶
WithCreatedTime DID doc created time.
func WithPublicKey ¶
WithPublicKey DID doc PublicKey.
func WithUpdatedTime ¶
WithUpdatedTime DID doc updated time.
type Proof ¶
type Proof struct {
	Type       string
	Created    *time.Time
	Creator    string
	ProofValue []byte
	Domain     string
	Nonce      []byte
}
    Proof is cryptographic proof of the integrity of the DID Document
type Service ¶
type Service struct {
	ID              string
	Type            string
	ServiceEndpoint string
	Properties      map[string]interface{}
}
    Service DID doc service
type VerificationMethod ¶
type VerificationMethod struct {
	PublicKey PublicKey
}
    VerificationMethod authentication verification method
 Click to show internal directories. 
   Click to hide internal directories.