Documentation ¶
Index ¶
- Variables
- func FormatKeyURI(pubk crypto.PubKey) string
- func ParseKeyURI(uri string) (crypto.PubKey, error)
- func PublicKeyFromDID(did DID) (crypto.PubKey, error)
- type Anchor
- type BasicTrustContext
- func (ctx *BasicTrustContext) AddAnchor(anchor Anchor)
- func (ctx *BasicTrustContext) AddProvider(provider Provider)
- func (ctx *BasicTrustContext) Anchors() []DID
- func (ctx *BasicTrustContext) GetAnchor(did DID) (Anchor, error)
- func (ctx *BasicTrustContext) GetProvider(did DID) (Provider, error)
- func (ctx *BasicTrustContext) Providers() []DID
- func (ctx *BasicTrustContext) Start(gcInterval time.Duration)
- func (ctx *BasicTrustContext) Stop()
- type DID
- type GetAnchorFunc
- type LedgerKeyOutput
- type LedgerSignECDSAOutput
- type LedgerSignOutput
- type LedgerWalletProvider
- type PrivateKeyProvider
- type Provider
- type PublicKeyAnchor
- type TrustContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidDID = errors.New("invalid DID") ErrInvalidKeyType = errors.New("invalid key type") ErrInvalidSignature = errors.New("signature verification failed") ErrNoProvider = errors.New("no provider") ErrNoAnchorMethod = errors.New("no anchor method") ErrHardwareKey = errors.New("hardware key") ErrTODO = errors.New("TODO") )
Functions ¶
func FormatKeyURI ¶
Types ¶
type Anchor ¶
Anchor is a DID anchor that encapsulates a public key that can be used for verification of signatures.
func GetAnchorForDID ¶
type BasicTrustContext ¶
type BasicTrustContext struct {
// contains filtered or unexported fields
}
func (*BasicTrustContext) AddAnchor ¶
func (ctx *BasicTrustContext) AddAnchor(anchor Anchor)
func (*BasicTrustContext) AddProvider ¶
func (ctx *BasicTrustContext) AddProvider(provider Provider)
func (*BasicTrustContext) Anchors ¶
func (ctx *BasicTrustContext) Anchors() []DID
func (*BasicTrustContext) GetAnchor ¶
func (ctx *BasicTrustContext) GetAnchor(did DID) (Anchor, error)
func (*BasicTrustContext) GetProvider ¶
func (ctx *BasicTrustContext) GetProvider(did DID) (Provider, error)
func (*BasicTrustContext) Providers ¶
func (ctx *BasicTrustContext) Providers() []DID
func (*BasicTrustContext) Start ¶
func (ctx *BasicTrustContext) Start(gcInterval time.Duration)
func (*BasicTrustContext) Stop ¶
func (ctx *BasicTrustContext) Stop()
type DID ¶
type DID struct {
URI string `json:"uri,omitempty"`
}
func FromPublicKey ¶
func FromString ¶
func (DID) Identifier ¶
type GetAnchorFunc ¶
type LedgerKeyOutput ¶
type LedgerSignECDSAOutput ¶
type LedgerSignOutput ¶
type LedgerSignOutput struct {
ECDSA LedgerSignECDSAOutput `json:"ecdsa"`
}
type LedgerWalletProvider ¶
type LedgerWalletProvider struct {
// contains filtered or unexported fields
}
func (*LedgerWalletProvider) Anchor ¶
func (p *LedgerWalletProvider) Anchor() Anchor
func (*LedgerWalletProvider) DID ¶
func (p *LedgerWalletProvider) DID() DID
func (*LedgerWalletProvider) PrivateKey ¶
func (p *LedgerWalletProvider) PrivateKey() (crypto.PrivKey, error)
type PrivateKeyProvider ¶
type PrivateKeyProvider struct {
// contains filtered or unexported fields
}
func (*PrivateKeyProvider) Anchor ¶
func (p *PrivateKeyProvider) Anchor() Anchor
func (*PrivateKeyProvider) DID ¶
func (p *PrivateKeyProvider) DID() DID
func (*PrivateKeyProvider) PrivateKey ¶
func (p *PrivateKeyProvider) PrivateKey() (crypto.PrivKey, error)
type Provider ¶
type Provider interface { DID() DID Sign(data []byte) ([]byte, error) Anchor() Anchor PrivateKey() (crypto.PrivKey, error) }
Provider holds the private key material necessary to sign statements for a DID.
func NewLedgerWalletProvider ¶
type PublicKeyAnchor ¶
type PublicKeyAnchor struct {
// contains filtered or unexported fields
}
func (*PublicKeyAnchor) DID ¶
func (a *PublicKeyAnchor) DID() DID
func (*PublicKeyAnchor) PublicKey ¶
func (a *PublicKeyAnchor) PublicKey() crypto.PubKey
type TrustContext ¶
type TrustContext interface { Anchors() []DID Providers() []DID GetAnchor(did DID) (Anchor, error) GetProvider(did DID) (Provider, error) AddAnchor(anchor Anchor) AddProvider(provider Provider) Start(gcInterval time.Duration) Stop() }
func NewTrustContext ¶
func NewTrustContext() TrustContext
func NewTrustContextWithPrivateKey ¶
func NewTrustContextWithPrivateKey(privk crypto.PrivKey) (TrustContext, error)
func NewTrustContextWithProvider ¶
func NewTrustContextWithProvider(p Provider) TrustContext
Click to show internal directories.
Click to hide internal directories.