trust

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoFilename = errors.New("no filename specified")

ErrNoFilename is returned when trust actions are performed but no file for storing those is specified.

Functions

This section is empty.

Types

type Config

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

Config holds the trusted issuers per credential type

func NewConfig

func NewConfig(filename string) *Config

NewConfig returns a fully configured Config

func (*Config) AddTrust

func (tc *Config) AddTrust(credentialType ssi.URI, issuer ssi.URI) error

AddTrust adds trust in a specific Issuer for a credential type. It returns an error if the Save fails

func (*Config) IsTrusted

func (tc *Config) IsTrusted(credentialType ssi.URI, issuer ssi.URI) bool

IsTrusted returns true when the given issuer is in the trusted issuers list of the given credentialType

func (*Config) List

func (tc *Config) List(credentialType ssi.URI) []ssi.URI

List returns all trusted issuers for the given type

func (*Config) Load

func (tc *Config) Load() error

Load the trusted issuers per credential type from file

func (*Config) RemoveTrust

func (tc *Config) RemoveTrust(credentialType ssi.URI, issuer ssi.URI) error

RemoveTrust removes trust in a specific Issuer for a credential type. It returns an error if the Save fails

Jump to

Keyboard shortcuts

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