Documentation
¶
Index ¶
- func FormatDID(method DIDMethod, identifier DIDIdentifier) string
- func ParseDID(did string) (DIDMethod, DIDIdentifier, error)
- type AnySignerEntity
- type BroadcastTxResponse
- type ControllerAccount
- type Credential
- type DIDAccumulator
- func (zk DIDAccumulator) Add(id string, key DIDSecretKey) error
- func (zk DIDAccumulator) Identifier() DIDIdentifier
- func (zk DIDAccumulator) Key() string
- func (zk DIDAccumulator) Remove(id string, key DIDSecretKey) error
- func (zk DIDAccumulator) String() string
- func (zk DIDAccumulator) Validate(id string, key DIDSecretKey) (bool, error)
- func (zk DIDAccumulator) Value() string
- type DIDIdentifier
- func (d DIDIdentifier) AddResource(k string, v []byte) (DIDResource, error)
- func (d DIDIdentifier) AppendKeyList(key string, values ...string)
- func (d DIDIdentifier) FetchResource(k string) ([]byte, error)
- func (d DIDIdentifier) GetKey(key string) string
- func (d DIDIdentifier) GetKeyList(key string) []string
- func (d DIDIdentifier) HasKey(key string) bool
- func (d DIDIdentifier) RemoveKeyList(key string, values ...string)
- func (d DIDIdentifier) SetKey(key string, value string)
- func (d DIDIdentifier) String() string
- type DIDMethod
- type DIDProperty
- type DIDResource
- type DIDSecretKey
- type DIDStore
- func (g *DIDStore) AppendList(key string, values ...string) error
- func (g *DIDStore) GetKey(k string) (string, error)
- func (g *DIDStore) GetList(key string) ([]string, error)
- func (g *DIDStore) HasKey(k string) (bool, error)
- func (g *DIDStore) RemoveList(key string, values ...string) error
- func (g *DIDStore) SetKey(k string, v string) error
- func (g *DIDStore) StoreKey() string
- type DIDUrl
- type TxResponse
- type WalletAccount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDID ¶
func FormatDID(method DIDMethod, identifier DIDIdentifier) string
FormatDID formats a DID string
Types ¶
type AnySignerEntity ¶
type AnySignerEntity interface { Sign([]byte) ([]byte, error) PublicKey() (*crypto.Secp256k1PubKey, error) Verify(msg []byte, sig []byte) (bool, error) }
AnySignerEntity is an entity that can sign and verify messages
type BroadcastTxResponse ¶
type BroadcastTxResponse = txtypes.BroadcastTxResponse
BroadcastTxResponse is a tx response
type ControllerAccount ¶
type ControllerAccount = identitytypes.ControllerAccount
ControllerAccount is an interface for a controller account
type Credential ¶
type Credential = servicetypes.WebauthnCredential
Credential is a webauthn credential
type DIDAccumulator ¶
type DIDAccumulator string
DIDAccumulator is a ZKSet accumulator for a DID
func NewAccumulator ¶
func NewAccumulator(id DIDIdentifier, key string) DIDAccumulator
NewAccumulator creates a new accumulator for the DID
func (DIDAccumulator) Add ¶
func (zk DIDAccumulator) Add(id string, key DIDSecretKey) error
Add adds a new element to the accumulator
func (DIDAccumulator) Identifier ¶
func (zk DIDAccumulator) Identifier() DIDIdentifier
Identifier returns the identifier of the resource
func (DIDAccumulator) Key ¶
func (zk DIDAccumulator) Key() string
Key returns the key of the resource
func (DIDAccumulator) Remove ¶
func (zk DIDAccumulator) Remove(id string, key DIDSecretKey) error
Remove removes an element from the accumulator
func (DIDAccumulator) String ¶
func (zk DIDAccumulator) String() string
String returns the string representation of the property
func (DIDAccumulator) Validate ¶
func (zk DIDAccumulator) Validate(id string, key DIDSecretKey) (bool, error)
Validate checks if the accumulator contains an element
func (DIDAccumulator) Value ¶
func (zk DIDAccumulator) Value() string
Value Returns the value for the Properties key
type DIDIdentifier ¶
type DIDIdentifier string
DIDIdentifier is a DID identifier
func (DIDIdentifier) AddResource ¶
func (d DIDIdentifier) AddResource(k string, v []byte) (DIDResource, error)
AddResource adds a resource to the store
func (DIDIdentifier) AppendKeyList ¶
func (d DIDIdentifier) AppendKeyList(key string, values ...string)
AppendKeyList appends a list of values to the key
func (DIDIdentifier) FetchResource ¶
func (d DIDIdentifier) FetchResource(k string) ([]byte, error)
FetchResource fetches a resource from the store
func (DIDIdentifier) GetKey ¶
func (d DIDIdentifier) GetKey(key string) string
GetKey returns the value for the key
func (DIDIdentifier) GetKeyList ¶
func (d DIDIdentifier) GetKeyList(key string) []string
GetKeyList returns the list of values for the key
func (DIDIdentifier) HasKey ¶
func (d DIDIdentifier) HasKey(key string) bool
HasKey returns true if the key exists in the store
func (DIDIdentifier) RemoveKeyList ¶
func (d DIDIdentifier) RemoveKeyList(key string, values ...string)
RemoveKeyList removes a list of values from the key
func (DIDIdentifier) SetKey ¶
func (d DIDIdentifier) SetKey(key string, value string)
SetKey sets the value for the key
func (DIDIdentifier) String ¶
func (d DIDIdentifier) String() string
String returns the string representation of the DID
type DIDMethod ¶
type DIDMethod string
DIDMethod is a DID method
type DIDProperty ¶
type DIDProperty string
DIDProperty is a string that is stored under a DID identifier in its internal store.
func NewProperty ¶
func NewProperty(id DIDIdentifier, key string) DIDProperty
NewProperty creates a new property for the DID
func (DIDProperty) Identifier ¶
func (d DIDProperty) Identifier() DIDIdentifier
Identifier returns the identifier of the resource
func (DIDProperty) String ¶
func (d DIDProperty) String() string
String returns the string representation of the property
func (DIDProperty) Value ¶
func (d DIDProperty) Value() string
Value Returns the value for the Properties key
type DIDResource ¶
type DIDResource string
DIDResource is a byte array that is stored under a DID identifier in its internal store.
func NewResource ¶
func NewResource(id DIDIdentifier, key string) DIDResource
NewResource returns a new DID resource from a DID URL, and key
func (DIDResource) Data ¶
func (d DIDResource) Data() ([]byte, error)
Data returns the data stored in the resource
func (DIDResource) Identifier ¶
func (d DIDResource) Identifier() DIDIdentifier
Identifier returns the identifier of the resource
func (DIDResource) String ¶
func (d DIDResource) String() string
String returns the string representation of the resource
func (DIDResource) Update ¶
func (d DIDResource) Update(data []byte) error
Update replaces the data stored in the resource
type DIDSecretKey ¶
type DIDSecretKey interface { // AccumulatorKey returns the accumulator key for the DID AccumulatorKey() (*accumulator.SecretKey, error) // Bytes returns the bytes of the secret key Bytes() []byte // Encrypt encrypts a byte array Encrypt(bz []byte) ([]byte, error) // Decrypt decrypts a byte array Decrypt(ciphertext []byte) ([]byte, error) }
DIDSecretKey is an interface for a DID secret key
type DIDStore ¶
type DIDStore struct { Name string Store sfs.Map Method DIDMethod Identifier DIDIdentifier IsMethod bool }
DIDStore is a store for a DID
func GetIdentifierStore ¶
func GetIdentifierStore(name DIDIdentifier) *DIDStore
GetIdentifierStore returns a store for a DID identifier
func GetMethodStore ¶
GetMethodStore returns a store for a DID method
func (*DIDStore) AppendList ¶
AppendList appends a list of values to a key in the store
func (*DIDStore) RemoveList ¶
RemoveList removes a list of values from a key in the store
type DIDUrl ¶
type DIDUrl string
DIDUrl is a DID URL
var EmptyDIDURL DIDUrl = ""
EmptyDIDURL is an empty DID URL
func NewDIDUrl ¶
func NewDIDUrl(method DIDMethod, id DIDIdentifier) DIDUrl
NewDIDUrl creates a new DID URL
func (DIDUrl) Identifier ¶
func (d DIDUrl) Identifier() (DIDIdentifier, error)
Identifier returns the identifier of the DID URL
type WalletAccount ¶
type WalletAccount interface { // Address returns the address of the account Address() string Info() *crypto.AccountData Method() DIDMethod Sign(msg []byte) ([]byte, error) PublicKey() (*crypto.Secp256k1PubKey, error) Type() string Verify(msg []byte, sig []byte) (bool, error) }
WalletAccount is an interface that provides acces to a DID Wallet