trustbloc

package module
v0.0.0-...-1a43f7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 37 Imported by: 9

Documentation

Overview

Package trustbloc implement trustbloc vdr

Index

Constants

View Source
const (
	// DIDMethod did method.
	DIDMethod = "trustbloc"
	// EndpointsOpt endpoints opt.
	EndpointsOpt = "endpoints"
	// UpdatePublicKeyOpt update public key opt.
	UpdatePublicKeyOpt = "updatePublicKey"
	// RecoveryPublicKeyOpt recovery public key opt.
	RecoveryPublicKeyOpt = "recoveryPublicKey"
	// RecoverOpt recover opt.
	RecoverOpt = "recover"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyRetriever

type KeyRetriever interface {
	GetNextRecoveryPublicKey(didID string) (crypto.PublicKey, error)
	GetNextUpdatePublicKey(didID string) (crypto.PublicKey, error)
	GetSigningKey(didID string, ot OperationType) (crypto.PrivateKey, error)
}

KeyRetriever key retriever.

type OperationType

type OperationType int

OperationType operation type.

const (
	// Update operation.
	Update OperationType = iota
	// Recover operation.
	Recover
)

type Option

type Option func(opts *VDR)

Option configures the bloc vdr.

func EnableSignatureVerification

func EnableSignatureVerification(enable bool) Option

EnableSignatureVerification enables signature verification.

func UseGenesisFile

func UseGenesisFile(url, domain string, genesisFile []byte) Option

UseGenesisFile adds a consortium genesis file to the VDR and enables consortium config update validation.

func WithAuthToken

func WithAuthToken(authToken string) Option

WithAuthToken add auth token.

func WithDocumentLoader

func WithDocumentLoader(docLoader jsonld.DocumentLoader) Option

WithDocumentLoader sets a JSON-LD document loader.

func WithDomain

func WithDomain(domain string) Option

WithDomain option is setting domain.

func WithResolverURL

func WithResolverURL(resolverURL string) Option

WithResolverURL option is setting resolver url.

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig option is for definition of secured HTTP transport using a tls.Config instance.

type VDR

type VDR struct {
	// contains filtered or unexported fields
}

VDR bloc.

func New

func New(keyRetriever KeyRetriever, opts ...Option) (*VDR, error)

New creates new bloc vdru.

func (*VDR) Accept

func (v *VDR) Accept(method string) bool

Accept did method.

func (*VDR) Close

func (v *VDR) Close() error

Close vdr.

func (*VDR) Create

func (v *VDR) Create(did *docdid.Doc,
	opts ...vdrapi.DIDMethodOption) (*docdid.DocResolution, error)

Create did doc. nolint: funlen,gocyclo

func (*VDR) Deactivate

func (v *VDR) Deactivate(didID string, opts ...vdrapi.DIDMethodOption) error

Deactivate did doc.

func (*VDR) Read

func (v *VDR) Read(did string, opts ...vdrapi.DIDMethodOption) (*docdid.DocResolution, error)

func (*VDR) Update

func (v *VDR) Update(didDoc *docdid.Doc, opts ...vdrapi.DIDMethodOption) error

Update did doc.

func (*VDR) ValidateConsortium

func (v *VDR) ValidateConsortium(consortiumDomain string) (*time.Duration, error)

ValidateConsortium validate the config and endorsement of a consortium and its stakeholders returns the duration after which the consortium config expires and needs re-validation.

Directories

Path Synopsis
config
httpconfig
Package httpconfig implement httpconfig
Package httpconfig implement httpconfig
memorycacheconfig
Package memorycacheconfig implement memorycacheconfig
Package memorycacheconfig implement memorycacheconfig
signatureconfig
Package signatureconfig implement signatureconfig
Package signatureconfig implement signatureconfig
updatevalidationconfig
Package updatevalidationconfig implement updatevalidationconfig
Package updatevalidationconfig implement updatevalidationconfig
verifyingconfig
Package verifyingconfig implement verifyingconfig
Package verifyingconfig implement verifyingconfig
Package didconfiguration implement didconfiguration service
Package didconfiguration implement didconfiguration service
discovery
staticdiscovery
Package staticdiscovery implement staticdiscovery
Package staticdiscovery implement staticdiscovery
Package endpoint implement endpoint service
Package endpoint implement endpoint service
internal
mock/config
Package config implement config
Package config implement config
mock/didconfiguration
Package didconfiguration implement didconfiguration
Package didconfiguration implement didconfiguration
mock/discovery
Package discovery implement discovery
Package discovery implement discovery
mock/endpoint
Package endpoint implement mock endpoint
Package endpoint implement mock endpoint
mock/models
Package models implement models
Package models implement models
mock/selection
Package discovery implement discovery
Package discovery implement discovery
Package models implement models
Package models implement models
selection
staticselection
Package staticselection implement staticselection
Package staticselection implement staticselection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL