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 for vc store.
NameSpace = "verifiable"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(o *options)
Opt represents option function.
func WithMyDID ¶
WithMyDID allows specifying MyDID for credential or presentation that is being issued.
func WithTheirDID ¶
WithTheirDID allows specifying TheirDID for credential or presentation that is being issued.
type Record ¶
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 ¶
type StoreImplementation struct {
// contains filtered or unexported fields
}
StoreImplementation stores vc.
func (*StoreImplementation) GetCredential ¶
func (s *StoreImplementation) GetCredential(id string) (*verifiable.Credential, error)
GetCredential retrieves a verifiable credential based on ID.
func (*StoreImplementation) GetCredentialIDByName ¶
func (s *StoreImplementation) GetCredentialIDByName(name string) (string, error)
GetCredentialIDByName retrieves verifiable credential id based on name.
func (*StoreImplementation) GetCredentials ¶
func (s *StoreImplementation) GetCredentials() ([]*Record, error)
GetCredentials retrieves the verifiable credential records containing name and fields of interest.
func (*StoreImplementation) GetPresentation ¶
func (s *StoreImplementation) GetPresentation(id string) (*verifiable.Presentation, error)
GetPresentation retrieves a verifiable presentation based on ID.
func (*StoreImplementation) GetPresentationIDByName ¶
func (s *StoreImplementation) GetPresentationIDByName(name string) (string, error)
GetPresentationIDByName retrieves verifiable presentation id based on name.
func (*StoreImplementation) GetPresentations ¶
func (s *StoreImplementation) GetPresentations() ([]*Record, error)
GetPresentations retrieves the verifiable presenations records containing name and fields of interest.
func (*StoreImplementation) RemoveCredentialByName ¶
func (s *StoreImplementation) RemoveCredentialByName(name string) error
RemoveCredentialByName removes the verifiable credential and its records containing given name.
func (*StoreImplementation) RemovePresentationByName ¶
func (s *StoreImplementation) RemovePresentationByName(name string) error
RemovePresentationByName removes the verifiable presentation and its records containing given name.
func (*StoreImplementation) SaveCredential ¶
func (s *StoreImplementation) SaveCredential(name string, vc *verifiable.Credential, opts ...Opt) error
SaveCredential saves a verifiable credential.
func (*StoreImplementation) SavePresentation ¶
func (s *StoreImplementation) SavePresentation(name string, vp *verifiable.Presentation, opts ...Opt) error
SavePresentation saves a verifiable presentation.