Documentation ¶
Index ¶
- Constants
- Variables
- func LookupDIDCommRecipientKeys(didDoc *Doc) ([]string, bool)
- type Context
- type DID
- type DIDURL
- type Doc
- type DocOption
- func WithAssertion(assertion []Verification) DocOption
- func WithAuthentication(auth []Verification) DocOption
- func WithCreatedTime(t time.Time) DocOption
- func WithKeyAgreement(keyAgreement []Verification) DocOption
- func WithService(svc []Service) DocOption
- func WithUpdatedTime(t time.Time) DocOption
- func WithVerificationMethod(pubKey []VerificationMethod) DocOption
- type DocResolution
- type DocumentMetadata
- type MethodMetadata
- type Proof
- type ProtocolOperation
- type Service
- type Verification
- type VerificationMethod
- func LookupPublicKey(id string, didDoc *Doc) (*VerificationMethod, bool)
- func NewVerificationMethodFromBytes(id, keyType, controller string, value []byte) *VerificationMethod
- func NewVerificationMethodFromBytesWithMultibase(id, keyType, controller string, value []byte, encoding multibase.Encoding) *VerificationMethod
- func NewVerificationMethodFromJWK(id, keyType, controller string, j *jwk.JWK) (*VerificationMethod, error)
- type VerificationRelationship
Constants ¶
const ( // ContextV1 of the DID document is the current V1 context name. ContextV1 = didmodel.ContextV1 // ContextV1Old of the DID document representing the old/legacy V1 context name. ContextV1Old = didmodel.ContextV1Old )
const ( // VerificationRelationshipGeneral is a special case of verification relationship: when a verification method // defined in Verification is not used by any Verification. VerificationRelationshipGeneral = didmodel.VerificationRelationshipGeneral // Authentication defines verification relationship. Authentication = didmodel.Authentication // AssertionMethod defines verification relationship. AssertionMethod = didmodel.AssertionMethod // CapabilityDelegation defines verification relationship. CapabilityDelegation = didmodel.CapabilityDelegation // CapabilityInvocation defines verification relationship. CapabilityInvocation = didmodel.CapabilityInvocation // KeyAgreement defines verification relationship. KeyAgreement = didmodel.KeyAgreement )
Variables ¶
var ErrDIDDocumentNotExist = didmodel.ErrDIDDocumentNotExist
ErrDIDDocumentNotExist error did doc not exist.
var ErrKeyNotFound = didmodel.ErrKeyNotFound
ErrKeyNotFound is returned when key is not found.
var ErrProofNotFound = didmodel.ErrProofNotFound
ErrProofNotFound is returned when proof is not found.
Functions ¶
func LookupDIDCommRecipientKeys ¶ added in v0.1.6
LookupDIDCommRecipientKeys gets the DIDComm recipient keys from the did doc which match the given parameters. DIDComm recipient keys are encoded as did:key identifiers. See: - https://github.com/hyperledger/aries-rfcs/blob/master/features/0067-didcomm-diddoc-conventions/README.md - https://github.com/hyperledger/aries-rfcs/blob/master/features/0360-use-did-key/README.md
Types ¶
type Context ¶
Context represents JSON-LD representation-specific DID-core @context, which must be either a string, or a list containing maps and/or strings.
type DID ¶ added in v0.1.3
DID is parsed according to the generic syntax: https://w3c.github.io/did-core/#generic-did-syntax
type DIDURL ¶ added in v0.1.8
DIDURL holds a DID URL.
func ParseDIDURL ¶ added in v0.1.8
ParseDIDURL parses a DID URL string into a DIDURL object.
type Doc ¶
Doc DID Document definition.
func ParseDocument ¶
ParseDocument creates an instance of DIDDocument by reading a JSON document from bytes.
type DocOption ¶
DocOption provides options to build DID Doc.
func WithAssertion ¶ added in v0.1.5
func WithAssertion(assertion []Verification) DocOption
WithAssertion sets the verification methods for assertion: https://w3c.github.io/did-core/#assertion.
func WithAuthentication ¶
func WithAuthentication(auth []Verification) DocOption
WithAuthentication sets the verification methods for authentication: https://w3c.github.io/did-core/#authentication.
func WithCreatedTime ¶
WithCreatedTime DID doc created time.
func WithKeyAgreement ¶ added in v0.1.7
func WithKeyAgreement(keyAgreement []Verification) DocOption
WithKeyAgreement sets the verification methods for KeyAgreement: https://w3c.github.io/did-core/#key-agreement.
func WithUpdatedTime ¶
WithUpdatedTime DID doc updated time.
func WithVerificationMethod ¶ added in v0.1.5
func WithVerificationMethod(pubKey []VerificationMethod) DocOption
WithVerificationMethod DID doc VerificationMethod.
type DocResolution ¶ added in v0.1.6
type DocResolution = didmodel.DocResolution
DocResolution did resolution.
func ParseDocumentResolution ¶ added in v0.1.6
func ParseDocumentResolution(data []byte) (*DocResolution, error)
ParseDocumentResolution parse document resolution.
type DocumentMetadata ¶ added in v0.1.6
type DocumentMetadata = didmodel.DocumentMetadata
DocumentMetadata document metadata.
type MethodMetadata ¶ added in v0.1.6
type MethodMetadata = didmodel.MethodMetadata
MethodMetadata method metadata.
type ProtocolOperation ¶ added in v0.1.9
type ProtocolOperation = didmodel.ProtocolOperation
ProtocolOperation info.
type Verification ¶ added in v0.1.5
type Verification = didmodel.Verification
Verification authentication verification.
func NewEmbeddedVerification ¶ added in v0.1.5
func NewEmbeddedVerification(vm *VerificationMethod, r VerificationRelationship) *Verification
NewEmbeddedVerification creates a new verification method with embedded verification method.
func NewReferencedVerification ¶ added in v0.1.5
func NewReferencedVerification(vm *VerificationMethod, r VerificationRelationship) *Verification
NewReferencedVerification creates a new verification method with referenced verification method.
type VerificationMethod ¶
type VerificationMethod = didmodel.VerificationMethod
VerificationMethod DID doc verification method. The value of the verification method is defined either as raw public key bytes (Value field) or as JSON Web Key. In the first case the Type field can hold additional information to understand the nature of the raw public key.
func LookupPublicKey ¶ added in v0.1.1
func LookupPublicKey(id string, didDoc *Doc) (*VerificationMethod, bool)
LookupPublicKey returns the public key with the given id from the given DID Doc.
func NewVerificationMethodFromBytes ¶ added in v0.1.5
func NewVerificationMethodFromBytes(id, keyType, controller string, value []byte) *VerificationMethod
NewVerificationMethodFromBytes creates a new VerificationMethod based on raw public key bytes.
func NewVerificationMethodFromBytesWithMultibase ¶ added in v0.1.8
func NewVerificationMethodFromBytesWithMultibase(id, keyType, controller string, value []byte, encoding multibase.Encoding) *VerificationMethod
NewVerificationMethodFromBytesWithMultibase creates a new VerificationMethod based on raw public key bytes with multibase.
func NewVerificationMethodFromJWK ¶ added in v0.1.5
func NewVerificationMethodFromJWK(id, keyType, controller string, j *jwk.JWK) (*VerificationMethod, error)
NewVerificationMethodFromJWK creates a new VerificationMethod based on JSON Web Key.
type VerificationRelationship ¶ added in v0.1.3
type VerificationRelationship = didmodel.VerificationRelationship
VerificationRelationship defines a verification relationship between DID subject and a verification method.