Documentation
¶
Overview ¶
Package types is a generated GoMock package.
Index ¶
- Constants
- Variables
- type CompoundService
- type DIDCreationOptions
- type DIDKeyFlags
- type DocCreator
- type DocFinder
- type DocIterator
- type DocManipulator
- type DocResolver
- type DocUpdater
- type DocWriter
- type DocumentMetadata
- type DocumentOwner
- type KeyResolver
- type MockDocCreator
- type MockDocCreatorMockRecorder
- type MockDocFinder
- type MockDocFinderMockRecorder
- type MockDocManipulator
- func (m *MockDocManipulator) AddVerificationMethod(ctx context.Context, id did.DID, keyUsage DIDKeyFlags) (*did.VerificationMethod, error)
- func (m *MockDocManipulator) Deactivate(ctx context.Context, id did.DID) error
- func (m *MockDocManipulator) EXPECT() *MockDocManipulatorMockRecorder
- func (m *MockDocManipulator) RemoveVerificationMethod(ctx context.Context, id, keyID did.DID) error
- type MockDocManipulatorMockRecorder
- func (mr *MockDocManipulatorMockRecorder) AddVerificationMethod(ctx, id, keyUsage interface{}) *gomock.Call
- func (mr *MockDocManipulatorMockRecorder) Deactivate(ctx, id interface{}) *gomock.Call
- func (mr *MockDocManipulatorMockRecorder) RemoveVerificationMethod(ctx, id, keyID interface{}) *gomock.Call
- type MockDocResolver
- type MockDocResolverMockRecorder
- type MockDocUpdater
- type MockDocUpdaterMockRecorder
- type MockDocWriter
- type MockDocWriterMockRecorder
- type MockDocumentOwner
- type MockDocumentOwnerMockRecorder
- type MockKeyResolver
- func (m *MockKeyResolver) EXPECT() *MockKeyResolverMockRecorder
- func (m *MockKeyResolver) ResolveAssertionKeyID(id did.DID) (ssi.URI, error)
- func (m *MockKeyResolver) ResolveKeyAgreementKey(id did.DID) (crypto.PublicKey, error)
- func (m *MockKeyResolver) ResolvePublicKey(kid string, sourceTransactionsRefs []hash.SHA256Hash) (crypto.PublicKey, error)
- func (m *MockKeyResolver) ResolveRelationKey(keyID string, validAt *time.Time, relationType RelationType) (crypto.PublicKey, error)
- func (m *MockKeyResolver) ResolveRelationKeyID(id did.DID, relationType RelationType) (ssi.URI, error)
- func (m *MockKeyResolver) ResolveSigningKey(keyID string, validAt *time.Time) (crypto.PublicKey, error)
- func (m *MockKeyResolver) ResolveSigningKeyID(holder did.DID, validAt *time.Time) (string, error)
- type MockKeyResolverMockRecorder
- func (mr *MockKeyResolverMockRecorder) ResolveAssertionKeyID(id interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolveKeyAgreementKey(id interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolvePublicKey(kid, sourceTransactionsRefs interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolveRelationKey(keyID, validAt, relationType interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolveRelationKeyID(id, relationType interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolveSigningKey(keyID, validAt interface{}) *gomock.Call
- func (mr *MockKeyResolverMockRecorder) ResolveSigningKeyID(holder, validAt interface{}) *gomock.Call
- type MockPredicate
- type MockPredicateMockRecorder
- type MockServiceResolver
- type MockServiceResolverMockRecorder
- type MockVDR
- func (m *MockVDR) ConflictedDocuments() ([]did.Document, []DocumentMetadata, error)
- func (m *MockVDR) Create(ctx context.Context, options DIDCreationOptions) (*did.Document, crypto0.Key, error)
- func (m *MockVDR) EXPECT() *MockVDRMockRecorder
- func (m *MockVDR) IsOwner(arg0 context.Context, arg1 did.DID) (bool, error)
- func (m *MockVDR) ListOwned(ctx context.Context) ([]did.DID, error)
- func (m *MockVDR) Update(ctx context.Context, id did.DID, next did.Document) error
- type MockVDRMockRecorder
- func (mr *MockVDRMockRecorder) ConflictedDocuments() *gomock.Call
- func (mr *MockVDRMockRecorder) Create(ctx, options interface{}) *gomock.Call
- func (mr *MockVDRMockRecorder) IsOwner(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockVDRMockRecorder) ListOwned(ctx interface{}) *gomock.Call
- func (mr *MockVDRMockRecorder) Update(ctx, id, next interface{}) *gomock.Call
- type Predicate
- type RelationType
- type ResolveMetadata
- type ServiceResolver
- type VDR
Constants ¶
const BaseURLServiceType = "node-http-services-baseurl"
BaseURLServiceType is type of the DID service which holds the base URL of the node's HTTP services, exposed to other Nuts nodes. E.g. OpenID4VCI or OAuth2 endpoints.
Variables ¶
var ErrDIDAlreadyExists = errors.New("DID document already exists in the store")
ErrDIDAlreadyExists is returned when a DID already exists.
var ErrDIDNotManagedByThisNode = errors.New("DID document not managed by this node")
ErrDIDNotManagedByThisNode is returned when an operation needs the private key and if is not found on this host
var ErrDeactivated = deactivatedError{/* contains filtered or unexported fields */}
ErrDeactivated signals rejection due to document deactivation.
var ErrDuplicateService = errors.New("service type is duplicate")
ErrDuplicateService is returned when a DID Document contains a multiple services with the same type
var ErrKeyNotFound = errors.New("key not found in DID document")
ErrKeyNotFound is returned when a particular key or type of key is not found.
var ErrNoActiveController = deactivatedError{/* contains filtered or unexported fields */}
ErrNoActiveController The DID supplied to the DID resolution does not have any active controllers.
var ErrNotFound = errors.New("unable to find the DID document")
ErrNotFound The DID resolver was unable to find the DID document resulting from this resolution request.
var ErrServiceNotFound = errors.New("service not found in DID Document")
ErrServiceNotFound is returned when the service is not found on a DID
var ErrServiceReferenceToDeep = errors.New("service references are nested to deeply before resolving to a non-reference")
ErrServiceReferenceToDeep is returned when a service reference is chain is nested too deeply.
Functions ¶
This section is empty.
Types ¶
type CompoundService ¶
CompoundService is a service type that can be used as target for github.com/nuts-foundation/go-did/did/document.go#UnmarshalServiceEndpoint
type DIDCreationOptions ¶
type DIDCreationOptions struct {
// Controllers lists the DIDs that can control the new DID Document. If selfControl = true and controllers is not empty,
// the newly generated DID will be added to the list of controllers.
Controllers []did.DID
// KeyFlags specifies for what purposes the generated key can be used
KeyFlags DIDKeyFlags
// SelfControl indicates whether the generated DID Document can be altered with its own capabilityInvocation key.
// Defaults to true when not given.
SelfControl bool
}
DIDCreationOptions defines options for creating a DID Document.
type DIDKeyFlags ¶
type DIDKeyFlags uint
DIDKeyFlags is a bitmask used for specifying for what purposes a key in a DID document can be used (a.k.a. Verification Method relationships).
const ( // AssertionMethodUsage indicates if the generated key pair can be used for assertions. AssertionMethodUsage DIDKeyFlags = 1 << iota // AuthenticationUsage indicates if the generated key pair can be used for authentication. AuthenticationUsage // CapabilityDelegationUsage indicates if the generated key pair can be used for altering DID Documents. CapabilityDelegationUsage // CapabilityInvocationUsage indicates if the generated key pair can be used for capability invocations. CapabilityInvocationUsage // KeyAgreementUsage indicates if the generated key pair can be used for Key agreements. KeyAgreementUsage )
func (DIDKeyFlags) Is ¶
func (k DIDKeyFlags) Is(other DIDKeyFlags) bool
Is returns whether the specified DIDKeyFlags is enabled.
type DocCreator ¶
type DocCreator interface {
// Create creates a new DID document and returns it.
// The ID in the provided DID document will be ignored and a new one will be generated.
// If something goes wrong an error is returned.
// Implementors should generate private key and store it in a secure backend
Create(ctx context.Context, options DIDCreationOptions) (*did.Document, crypto2.Key, error)
}
DocCreator is the interface that wraps the Create method
type DocFinder ¶
DocFinder is the interface that groups all methods for finding DID documents based on search conditions
type DocIterator ¶
type DocIterator func(doc did.Document, metadata DocumentMetadata) error
DocIterator is the function type for iterating over the all current DID Documents in the store
type DocManipulator ¶
type DocManipulator interface {
// Deactivate deactivates a DID document
// Deactivation will be done in such a way that a DID doc cannot be used / activated anymore.
// Since the deactivation is definitive, no version is required
// If the DID Document is not found ErrNotFound is returned
// If the DID Document is not managed by this node, ErrDIDNotManagedByThisNode is returned
// If the DID Document is already deactivated ErrDeactivated is returned
Deactivate(ctx context.Context, id did.DID) error
// RemoveVerificationMethod removes a VerificationMethod from a DID document.
// It accepts the id DID as identifier for the DID document.
// It accepts the kid DID as identifier for the VerificationMethod.
// It returns an ErrNotFound when the DID document could not be found.
// It returns an ErrNotFound when there is no VerificationMethod with the provided kid in the document.
// It returns an ErrDeactivated when the DID document has the deactivated state.
// It returns an ErrDIDNotManagedByThisNode if the DID document is not managed by this node.
RemoveVerificationMethod(ctx context.Context, id, keyID did.DID) error
// AddVerificationMethod generates a new key and adds it, wrapped as a VerificationMethod, to a DID document.
// It accepts a DID as identifier for the DID document.
// It returns an ErrNotFound when the DID document could not be found.
// It returns an ErrDeactivated when the DID document has the deactivated state.
// It returns an ErrDIDNotManagedByThisNode if the DID document is not managed by this node.
AddVerificationMethod(ctx context.Context, id did.DID, keyUsage DIDKeyFlags) (*did.VerificationMethod, error)
}
DocManipulator groups several higher level methods to alter the state of a DID document.
type DocResolver ¶
type DocResolver interface {
// Resolve returns a DID Document for the provided DID.
// If metadata is not provided the latest version is returned.
// If metadata is provided then the result is filtered or scoped on that metadata.
// It returns ErrNotFound if there are no corresponding DID documents or when the DID Documents are disjoint with the provided ResolveMetadata
// It returns ErrDeactivated if the DID Document has been deactivated and metadata is unset or metadata.AllowDeactivated is false.
// It returns ErrNoActiveController if all of the DID Documents controllers have been deactivated and metadata is unset or metadata.AllowDeactivated is false.
Resolve(id did.DID, metadata *ResolveMetadata) (*did.Document, *DocumentMetadata, error)
// ResolveControllers finds the DID Document controllers
ResolveControllers(input did.Document, metadata *ResolveMetadata) ([]did.Document, error)
}
DocResolver is the interface that groups all the DID Document read methods
type DocUpdater ¶
type DocUpdater interface {
// Update replaces the DID document identified by DID with the nextVersion
// If the DID Document is not found, ErrNotFound is returned
// If the DID Document is not managed by this node, ErrDIDNotManagedByThisNode is returned
Update(ctx context.Context, id did.DID, next did.Document) error
}
DocUpdater is the interface that defines functions that alter the state of a DID document
type DocWriter ¶
type DocWriter interface {
// Write writes a DID Document.
// Returns ErrDIDAlreadyExists when DID already exists
// When a document already exists, the Update should be used instead
Write(document did.Document, metadata DocumentMetadata) error
}
DocWriter is the interface that groups al the DID Document write methods
type DocumentMetadata ¶
type DocumentMetadata struct {
Created time.Time `json:"created"`
Updated *time.Time `json:"updated,omitempty"`
// Hash of DID document bytes. Is equal to payloadHash in network layer.
Hash hash.SHA256Hash `json:"hash"`
// PreviousHash of the previous version of this DID document
PreviousHash *hash.SHA256Hash `json:"previousHash,omitempty"`
// SourceTransactions points to the transaction(s) that created the current version of this DID Document.
// If multiple transactions are listed, the DID Document is conflicted
SourceTransactions []hash.SHA256Hash `json:"txs"`
// Deactivated indicates if the document is deactivated
Deactivated bool `json:"deactivated"`
}
DocumentMetadata holds the metadata of a DID document
func (DocumentMetadata) Copy ¶
func (m DocumentMetadata) Copy() DocumentMetadata
Copy creates a deep copy of DocumentMetadata
func (DocumentMetadata) IsConflicted ¶
func (m DocumentMetadata) IsConflicted() bool
IsConflicted returns if a DID Document is conflicted
type DocumentOwner ¶
type DocumentOwner interface {
// IsOwner returns true if the DID Document is owned by the node, meaning there are private keys present for the DID Document.
IsOwner(context.Context, did.DID) (bool, error)
// ListOwned returns all the DIDs owned by the node.
ListOwned(ctx context.Context) ([]did.DID, error)
}
DocumentOwner is the interface for checking DID document ownership (presence of private keys).
type KeyResolver ¶
type KeyResolver interface {
// ResolveSigningKeyID looks up a signing key of the specified holder. It returns the ID
// of the found key. Typically used to find a key for signing one's own documents. If no suitable keys
// are found an error is returned.
ResolveSigningKeyID(holder did.DID, validAt *time.Time) (string, error)
// ResolveSigningKey looks up a specific signing key and returns it as crypto.PublicKey. If the key can't be found
// or isn't meant for signing an error is returned.
ResolveSigningKey(keyID string, validAt *time.Time) (crypto.PublicKey, error)
// ResolveAssertionKeyID look for a valid assertion key for the give DID. If multiple keys are valid, the first one is returned.
// An ErrKeyNotFound is returned when no key is found.
ResolveAssertionKeyID(id did.DID) (ssi.URI, error)
// ResolveKeyAgreementKey look for a valid keyAgreement key for the give DID. If multiple keys are valid, the first one is returned.
// An ErrKeyNotFound is returned when no key is found.
ResolveKeyAgreementKey(id did.DID) (crypto.PublicKey, error)
// ResolvePublicKey loads the key from a DID Document where the DID Document
// was created with one of the given tx refs
// It returns ErrKeyNotFound when the key could not be found in the DID Document.
// It returns ErrNotFound when the DID Document can't be found.
ResolvePublicKey(kid string, sourceTransactionsRefs []hash.SHA256Hash) (crypto.PublicKey, error)
// ResolveRelationKey looks up a specific key of the given RelationType and returns it as crypto.PublicKey.
// If the key can't be found or isn't meant for signing an error is returned.
ResolveRelationKey(keyID string, validAt *time.Time, relationType RelationType) (crypto.PublicKey, error)
// ResolveRelationKeyID look for a valid key of the given RelationType for the give DID.
// If multiple keys are valid, the first one is returned.
// An ErrKeyNotFound is returned when no key is found.
ResolveRelationKeyID(id did.DID, relationType RelationType) (ssi.URI, error)
}
KeyResolver is the interface for resolving keys. This can be used for checking if a signing key is valid at a point in time or to just find a valid key for signing.
type MockDocCreator ¶
type MockDocCreator struct {
// contains filtered or unexported fields
}
MockDocCreator is a mock of DocCreator interface.
func NewMockDocCreator ¶
func NewMockDocCreator(ctrl *gomock.Controller) *MockDocCreator
NewMockDocCreator creates a new mock instance.
func (*MockDocCreator) Create ¶
func (m *MockDocCreator) Create(ctx context.Context, options DIDCreationOptions) (*did.Document, crypto0.Key, error)
Create mocks base method.
func (*MockDocCreator) EXPECT ¶
func (m *MockDocCreator) EXPECT() *MockDocCreatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDocCreatorMockRecorder ¶
type MockDocCreatorMockRecorder struct {
// contains filtered or unexported fields
}
MockDocCreatorMockRecorder is the mock recorder for MockDocCreator.
func (*MockDocCreatorMockRecorder) Create ¶
func (mr *MockDocCreatorMockRecorder) Create(ctx, options interface{}) *gomock.Call
Create indicates an expected call of Create.
type MockDocFinder ¶
type MockDocFinder struct {
// contains filtered or unexported fields
}
MockDocFinder is a mock of DocFinder interface.
func NewMockDocFinder ¶
func NewMockDocFinder(ctrl *gomock.Controller) *MockDocFinder
NewMockDocFinder creates a new mock instance.
func (*MockDocFinder) EXPECT ¶
func (m *MockDocFinder) EXPECT() *MockDocFinderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDocFinderMockRecorder ¶
type MockDocFinderMockRecorder struct {
// contains filtered or unexported fields
}
MockDocFinderMockRecorder is the mock recorder for MockDocFinder.
func (*MockDocFinderMockRecorder) Find ¶
func (mr *MockDocFinderMockRecorder) Find(arg0 ...interface{}) *gomock.Call
Find indicates an expected call of Find.
type MockDocManipulator ¶
type MockDocManipulator struct {
// contains filtered or unexported fields
}
MockDocManipulator is a mock of DocManipulator interface.
func NewMockDocManipulator ¶
func NewMockDocManipulator(ctrl *gomock.Controller) *MockDocManipulator
NewMockDocManipulator creates a new mock instance.
func (*MockDocManipulator) AddVerificationMethod ¶
func (m *MockDocManipulator) AddVerificationMethod(ctx context.Context, id did.DID, keyUsage DIDKeyFlags) (*did.VerificationMethod, error)
AddVerificationMethod mocks base method.
func (*MockDocManipulator) Deactivate ¶
Deactivate mocks base method.
func (*MockDocManipulator) EXPECT ¶
func (m *MockDocManipulator) EXPECT() *MockDocManipulatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDocManipulator) RemoveVerificationMethod ¶
RemoveVerificationMethod mocks base method.
type MockDocManipulatorMockRecorder ¶
type MockDocManipulatorMockRecorder struct {
// contains filtered or unexported fields
}
MockDocManipulatorMockRecorder is the mock recorder for MockDocManipulator.
func (*MockDocManipulatorMockRecorder) AddVerificationMethod ¶
func (mr *MockDocManipulatorMockRecorder) AddVerificationMethod(ctx, id, keyUsage interface{}) *gomock.Call
AddVerificationMethod indicates an expected call of AddVerificationMethod.
func (*MockDocManipulatorMockRecorder) Deactivate ¶
func (mr *MockDocManipulatorMockRecorder) Deactivate(ctx, id interface{}) *gomock.Call
Deactivate indicates an expected call of Deactivate.
func (*MockDocManipulatorMockRecorder) RemoveVerificationMethod ¶
func (mr *MockDocManipulatorMockRecorder) RemoveVerificationMethod(ctx, id, keyID interface{}) *gomock.Call
RemoveVerificationMethod indicates an expected call of RemoveVerificationMethod.
type MockDocResolver ¶
type MockDocResolver struct {
// contains filtered or unexported fields
}
MockDocResolver is a mock of DocResolver interface.
func NewMockDocResolver ¶
func NewMockDocResolver(ctrl *gomock.Controller) *MockDocResolver
NewMockDocResolver creates a new mock instance.
func (*MockDocResolver) EXPECT ¶
func (m *MockDocResolver) EXPECT() *MockDocResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDocResolver) Resolve ¶
func (m *MockDocResolver) Resolve(id did.DID, metadata *ResolveMetadata) (*did.Document, *DocumentMetadata, error)
Resolve mocks base method.
func (*MockDocResolver) ResolveControllers ¶
func (m *MockDocResolver) ResolveControllers(input did.Document, metadata *ResolveMetadata) ([]did.Document, error)
ResolveControllers mocks base method.
type MockDocResolverMockRecorder ¶
type MockDocResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockDocResolverMockRecorder is the mock recorder for MockDocResolver.
func (*MockDocResolverMockRecorder) Resolve ¶
func (mr *MockDocResolverMockRecorder) Resolve(id, metadata interface{}) *gomock.Call
Resolve indicates an expected call of Resolve.
func (*MockDocResolverMockRecorder) ResolveControllers ¶
func (mr *MockDocResolverMockRecorder) ResolveControllers(input, metadata interface{}) *gomock.Call
ResolveControllers indicates an expected call of ResolveControllers.
type MockDocUpdater ¶
type MockDocUpdater struct {
// contains filtered or unexported fields
}
MockDocUpdater is a mock of DocUpdater interface.
func NewMockDocUpdater ¶
func NewMockDocUpdater(ctrl *gomock.Controller) *MockDocUpdater
NewMockDocUpdater creates a new mock instance.
func (*MockDocUpdater) EXPECT ¶
func (m *MockDocUpdater) EXPECT() *MockDocUpdaterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDocUpdaterMockRecorder ¶
type MockDocUpdaterMockRecorder struct {
// contains filtered or unexported fields
}
MockDocUpdaterMockRecorder is the mock recorder for MockDocUpdater.
func (*MockDocUpdaterMockRecorder) Update ¶
func (mr *MockDocUpdaterMockRecorder) Update(ctx, id, next interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockDocWriter ¶
type MockDocWriter struct {
// contains filtered or unexported fields
}
MockDocWriter is a mock of DocWriter interface.
func NewMockDocWriter ¶
func NewMockDocWriter(ctrl *gomock.Controller) *MockDocWriter
NewMockDocWriter creates a new mock instance.
func (*MockDocWriter) EXPECT ¶
func (m *MockDocWriter) EXPECT() *MockDocWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDocWriter) Write ¶
func (m *MockDocWriter) Write(document did.Document, metadata DocumentMetadata) error
Write mocks base method.
type MockDocWriterMockRecorder ¶
type MockDocWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockDocWriterMockRecorder is the mock recorder for MockDocWriter.
func (*MockDocWriterMockRecorder) Write ¶
func (mr *MockDocWriterMockRecorder) Write(document, metadata interface{}) *gomock.Call
Write indicates an expected call of Write.
type MockDocumentOwner ¶
type MockDocumentOwner struct {
// contains filtered or unexported fields
}
MockDocumentOwner is a mock of DocumentOwner interface.
func NewMockDocumentOwner ¶
func NewMockDocumentOwner(ctrl *gomock.Controller) *MockDocumentOwner
NewMockDocumentOwner creates a new mock instance.
func (*MockDocumentOwner) EXPECT ¶
func (m *MockDocumentOwner) EXPECT() *MockDocumentOwnerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDocumentOwnerMockRecorder ¶
type MockDocumentOwnerMockRecorder struct {
// contains filtered or unexported fields
}
MockDocumentOwnerMockRecorder is the mock recorder for MockDocumentOwner.
func (*MockDocumentOwnerMockRecorder) IsOwner ¶
func (mr *MockDocumentOwnerMockRecorder) IsOwner(arg0, arg1 interface{}) *gomock.Call
IsOwner indicates an expected call of IsOwner.
func (*MockDocumentOwnerMockRecorder) ListOwned ¶
func (mr *MockDocumentOwnerMockRecorder) ListOwned(ctx interface{}) *gomock.Call
ListOwned indicates an expected call of ListOwned.
type MockKeyResolver ¶
type MockKeyResolver struct {
// contains filtered or unexported fields
}
MockKeyResolver is a mock of KeyResolver interface.
func NewMockKeyResolver ¶
func NewMockKeyResolver(ctrl *gomock.Controller) *MockKeyResolver
NewMockKeyResolver creates a new mock instance.
func (*MockKeyResolver) EXPECT ¶
func (m *MockKeyResolver) EXPECT() *MockKeyResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKeyResolver) ResolveAssertionKeyID ¶
ResolveAssertionKeyID mocks base method.
func (*MockKeyResolver) ResolveKeyAgreementKey ¶
ResolveKeyAgreementKey mocks base method.
func (*MockKeyResolver) ResolvePublicKey ¶
func (m *MockKeyResolver) ResolvePublicKey(kid string, sourceTransactionsRefs []hash.SHA256Hash) (crypto.PublicKey, error)
ResolvePublicKey mocks base method.
func (*MockKeyResolver) ResolveRelationKey ¶
func (m *MockKeyResolver) ResolveRelationKey(keyID string, validAt *time.Time, relationType RelationType) (crypto.PublicKey, error)
ResolveRelationKey mocks base method.
func (*MockKeyResolver) ResolveRelationKeyID ¶
func (m *MockKeyResolver) ResolveRelationKeyID(id did.DID, relationType RelationType) (ssi.URI, error)
ResolveRelationKeyID mocks base method.
func (*MockKeyResolver) ResolveSigningKey ¶
func (m *MockKeyResolver) ResolveSigningKey(keyID string, validAt *time.Time) (crypto.PublicKey, error)
ResolveSigningKey mocks base method.
func (*MockKeyResolver) ResolveSigningKeyID ¶
ResolveSigningKeyID mocks base method.
type MockKeyResolverMockRecorder ¶
type MockKeyResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyResolverMockRecorder is the mock recorder for MockKeyResolver.
func (*MockKeyResolverMockRecorder) ResolveAssertionKeyID ¶
func (mr *MockKeyResolverMockRecorder) ResolveAssertionKeyID(id interface{}) *gomock.Call
ResolveAssertionKeyID indicates an expected call of ResolveAssertionKeyID.
func (*MockKeyResolverMockRecorder) ResolveKeyAgreementKey ¶
func (mr *MockKeyResolverMockRecorder) ResolveKeyAgreementKey(id interface{}) *gomock.Call
ResolveKeyAgreementKey indicates an expected call of ResolveKeyAgreementKey.
func (*MockKeyResolverMockRecorder) ResolvePublicKey ¶
func (mr *MockKeyResolverMockRecorder) ResolvePublicKey(kid, sourceTransactionsRefs interface{}) *gomock.Call
ResolvePublicKey indicates an expected call of ResolvePublicKey.
func (*MockKeyResolverMockRecorder) ResolveRelationKey ¶
func (mr *MockKeyResolverMockRecorder) ResolveRelationKey(keyID, validAt, relationType interface{}) *gomock.Call
ResolveRelationKey indicates an expected call of ResolveRelationKey.
func (*MockKeyResolverMockRecorder) ResolveRelationKeyID ¶
func (mr *MockKeyResolverMockRecorder) ResolveRelationKeyID(id, relationType interface{}) *gomock.Call
ResolveRelationKeyID indicates an expected call of ResolveRelationKeyID.
func (*MockKeyResolverMockRecorder) ResolveSigningKey ¶
func (mr *MockKeyResolverMockRecorder) ResolveSigningKey(keyID, validAt interface{}) *gomock.Call
ResolveSigningKey indicates an expected call of ResolveSigningKey.
func (*MockKeyResolverMockRecorder) ResolveSigningKeyID ¶
func (mr *MockKeyResolverMockRecorder) ResolveSigningKeyID(holder, validAt interface{}) *gomock.Call
ResolveSigningKeyID indicates an expected call of ResolveSigningKeyID.
type MockPredicate ¶
type MockPredicate struct {
// contains filtered or unexported fields
}
MockPredicate is a mock of Predicate interface.
func NewMockPredicate ¶
func NewMockPredicate(ctrl *gomock.Controller) *MockPredicate
NewMockPredicate creates a new mock instance.
func (*MockPredicate) EXPECT ¶
func (m *MockPredicate) EXPECT() *MockPredicateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPredicate) Match ¶
func (m *MockPredicate) Match(arg0 did.Document, arg1 DocumentMetadata) bool
Match mocks base method.
type MockPredicateMockRecorder ¶
type MockPredicateMockRecorder struct {
// contains filtered or unexported fields
}
MockPredicateMockRecorder is the mock recorder for MockPredicate.
func (*MockPredicateMockRecorder) Match ¶
func (mr *MockPredicateMockRecorder) Match(arg0, arg1 interface{}) *gomock.Call
Match indicates an expected call of Match.
type MockServiceResolver ¶
type MockServiceResolver struct {
// contains filtered or unexported fields
}
MockServiceResolver is a mock of ServiceResolver interface.
func NewMockServiceResolver ¶
func NewMockServiceResolver(ctrl *gomock.Controller) *MockServiceResolver
NewMockServiceResolver creates a new mock instance.
func (*MockServiceResolver) EXPECT ¶
func (m *MockServiceResolver) EXPECT() *MockServiceResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockServiceResolverMockRecorder ¶
type MockServiceResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceResolverMockRecorder is the mock recorder for MockServiceResolver.
func (*MockServiceResolverMockRecorder) Resolve ¶
func (mr *MockServiceResolverMockRecorder) Resolve(query, maxDepth interface{}) *gomock.Call
Resolve indicates an expected call of Resolve.
func (*MockServiceResolverMockRecorder) ResolveEx ¶
func (mr *MockServiceResolverMockRecorder) ResolveEx(endpoint, depth, maxDepth, documentCache interface{}) *gomock.Call
ResolveEx indicates an expected call of ResolveEx.
type MockVDR ¶
type MockVDR struct {
// contains filtered or unexported fields
}
MockVDR is a mock of VDR interface.
func NewMockVDR ¶
func NewMockVDR(ctrl *gomock.Controller) *MockVDR
NewMockVDR creates a new mock instance.
func (*MockVDR) ConflictedDocuments ¶
func (m *MockVDR) ConflictedDocuments() ([]did.Document, []DocumentMetadata, error)
ConflictedDocuments mocks base method.
func (*MockVDR) Create ¶
func (m *MockVDR) Create(ctx context.Context, options DIDCreationOptions) (*did.Document, crypto0.Key, error)
Create mocks base method.
func (*MockVDR) EXPECT ¶
func (m *MockVDR) EXPECT() *MockVDRMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockVDRMockRecorder ¶
type MockVDRMockRecorder struct {
// contains filtered or unexported fields
}
MockVDRMockRecorder is the mock recorder for MockVDR.
func (*MockVDRMockRecorder) ConflictedDocuments ¶
func (mr *MockVDRMockRecorder) ConflictedDocuments() *gomock.Call
ConflictedDocuments indicates an expected call of ConflictedDocuments.
func (*MockVDRMockRecorder) Create ¶
func (mr *MockVDRMockRecorder) Create(ctx, options interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockVDRMockRecorder) IsOwner ¶
func (mr *MockVDRMockRecorder) IsOwner(arg0, arg1 interface{}) *gomock.Call
IsOwner indicates an expected call of IsOwner.
func (*MockVDRMockRecorder) ListOwned ¶
func (mr *MockVDRMockRecorder) ListOwned(ctx interface{}) *gomock.Call
ListOwned indicates an expected call of ListOwned.
func (*MockVDRMockRecorder) Update ¶
func (mr *MockVDRMockRecorder) Update(ctx, id, next interface{}) *gomock.Call
Update indicates an expected call of Update.
type Predicate ¶
type Predicate interface {
// Match returns true if the given DID Document passes the predicate condition
Match(did.Document, DocumentMetadata) bool
}
Predicate is an interface for abstracting search options on DID documents
type RelationType ¶
type RelationType uint
RelationType is the type that contains the different possible relationships between a DID Document and a VerificationMethod They are defined in the DID spec: https://www.w3.org/TR/did-core/#verification-relationships
const ( Authentication RelationType = iota AssertionMethod RelationType = iota KeyAgreement RelationType = iota CapabilityInvocation RelationType = iota CapabilityDelegation RelationType = iota )
type ResolveMetadata ¶
type ResolveMetadata struct {
// Resolve the version which is valid at this time
ResolveTime *time.Time
// if provided, use the version which matches this exact hash
Hash *hash.SHA256Hash
// SourceTransaction must match a TX hash from the metadata.SourceTransaction field, if provided
SourceTransaction *hash.SHA256Hash
// Allow DIDs which are deactivated
AllowDeactivated bool
}
ResolveMetadata contains metadata for the resolver.
type ServiceResolver ¶
type ServiceResolver interface {
// Resolve looks up the DID document of the specified query and then tries to find the service with the specified type.
// The query must be in the form of a service query, e.g. `did:nuts:12345/serviceEndpoint?type=some-type`.
// The maxDepth indicates how deep references are followed. If maxDepth = 0, no references are followed (and an error is returned if the given query resolves to a reference).
// If the DID document or service is not found, a reference can't be resolved or the references exceed maxDepth, an error is returned.
Resolve(query ssi.URI, maxDepth int) (did.Service, error)
// ResolveEx tries to resolve a DID service from the given endpoint URI, following references (URIs that begin with 'did:').
// When the endpoint is a reference it resolves it up until the (per spec) max reference depth. When resolving a reference it recursively calls itself with depth + 1.
// The documentCache map is used to avoid resolving the same document over and over again, which might be a (slightly more) expensive operation.
ResolveEx(endpoint ssi.URI, depth int, maxDepth int, documentCache map[string]*did.Document) (did.Service, error)
}
ServiceResolver allows looking up DID document services, following references.
type VDR ¶
type VDR interface {
DocumentOwner
DocCreator
DocUpdater
// ConflictedDocuments returns the DID Document and metadata of all documents with a conflict.
ConflictedDocuments() ([]did.Document, []DocumentMetadata, error)
}
VDR defines the public end facing methods for the Verifiable Data Registry.