Documentation
¶
Index ¶
- Constants
- type Opt
- type Record
- type Store
- type StoreImplementation
- func (s *StoreImplementation) GetCredential(id string) (*verifiable.Credential, error)
- func (s *StoreImplementation) GetCredentialIDByName(name string) (string, error)
- func (s *StoreImplementation) GetCredentials() ([]*Record, error)
- func (s *StoreImplementation) GetPresentation(id string) (*verifiable.Presentation, error)
- func (s *StoreImplementation) GetPresentationIDByName(name string) (string, error)
- func (s *StoreImplementation) GetPresentations() ([]*Record, error)
- func (s *StoreImplementation) RemoveCredentialByName(name string) error
- func (s *StoreImplementation) RemovePresentationByName(name string) error
- func (s *StoreImplementation) SaveCredential(name string, vc *verifiable.Credential, opts ...Opt) error
- func (s *StoreImplementation) SavePresentation(name string, vp *verifiable.Presentation, opts ...Opt) error
Constants ¶
const NameSpace = "verifiable"
NameSpace for vc store.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶ added in v0.1.4
type Opt func(o *options)
Opt represents option function.
func WithMyDID ¶ added in v0.1.4
WithMyDID allows specifying MyDID for credential or presentation that is being issued.
func WithTheirDID ¶ added in v0.1.4
WithTheirDID allows specifying TheirDID for credential or presentation that is being issued.
type Record ¶ added in v0.1.3
type Record struct {
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"`
Context []string `json:"context,omitempty"`
Type []string `json:"type,omitempty"`
SubjectID string `json:"subjectId,omitempty"`
// MyDID and TheirDID contains information about participants who were involved in the process
// of issuing a credential or presentation.
MyDID string `json:"my_did,omitempty"`
TheirDID string `json:"their_did,omitempty"`
}
Record model containing name, ID and other fields of interest.
type Store ¶
type Store interface {
SaveCredential(name string, vc *verifiable.Credential, opts ...Opt) error
SavePresentation(name string, vp *verifiable.Presentation, opts ...Opt) error
GetCredential(id string) (*verifiable.Credential, error)
GetPresentation(id string) (*verifiable.Presentation, error)
GetCredentialIDByName(name string) (string, error)
GetPresentationIDByName(name string) (string, error)
GetCredentials() ([]*Record, error)
GetPresentations() ([]*Record, error)
RemoveCredentialByName(name string) error
RemovePresentationByName(name string) error
}
Store provides interface for storing and managing verifiable credentials.
type StoreImplementation ¶ added in v0.1.4
type StoreImplementation struct {
// contains filtered or unexported fields
}
StoreImplementation stores vc.
func (*StoreImplementation) GetCredential ¶ added in v0.1.4
func (s *StoreImplementation) GetCredential(id string) (*verifiable.Credential, error)
GetCredential retrieves a verifiable credential based on ID.
func (*StoreImplementation) GetCredentialIDByName ¶ added in v0.1.4
func (s *StoreImplementation) GetCredentialIDByName(name string) (string, error)
GetCredentialIDByName retrieves verifiable credential id based on name.
func (*StoreImplementation) GetCredentials ¶ added in v0.1.4
func (s *StoreImplementation) GetCredentials() ([]*Record, error)
GetCredentials retrieves the verifiable credential records containing name and fields of interest.
func (*StoreImplementation) GetPresentation ¶ added in v0.1.4
func (s *StoreImplementation) GetPresentation(id string) (*verifiable.Presentation, error)
GetPresentation retrieves a verifiable presentation based on ID.
func (*StoreImplementation) GetPresentationIDByName ¶ added in v0.1.4
func (s *StoreImplementation) GetPresentationIDByName(name string) (string, error)
GetPresentationIDByName retrieves verifiable presentation id based on name.
func (*StoreImplementation) GetPresentations ¶ added in v0.1.4
func (s *StoreImplementation) GetPresentations() ([]*Record, error)
GetPresentations retrieves the verifiable presentations records containing name and fields of interest.
func (*StoreImplementation) RemoveCredentialByName ¶ added in v0.1.4
func (s *StoreImplementation) RemoveCredentialByName(name string) error
RemoveCredentialByName removes the verifiable credential and its records containing given name.
func (*StoreImplementation) RemovePresentationByName ¶ added in v0.1.4
func (s *StoreImplementation) RemovePresentationByName(name string) error
RemovePresentationByName removes the verifiable presentation and its records containing given name.
func (*StoreImplementation) SaveCredential ¶ added in v0.1.4
func (s *StoreImplementation) SaveCredential(name string, vc *verifiable.Credential, opts ...Opt) error
SaveCredential saves a verifiable credential.
func (*StoreImplementation) SavePresentation ¶ added in v0.1.4
func (s *StoreImplementation) SavePresentation(name string, vp *verifiable.Presentation, opts ...Opt) error
SavePresentation saves a verifiable presentation.