truststores

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupportedByTrustStore = errors.New("action not supported by trust store")

ErrNotSupportedByTrustStore is returned by trust stores if they do not support certain actions.

Functions

func LoadEnvelopeFromFile

func LoadEnvelopeFromFile(filename string) (*jess.Envelope, error)

LoadEnvelopeFromFile loads an envelope from the given filepath.

func LoadSignetFromFile

func LoadSignetFromFile(filename string) (*jess.Signet, error)

LoadSignetFromFile loads a signet from the given filepath.

func NamePlaysNiceWithFS

func NamePlaysNiceWithFS(s string) (ok bool)

NamePlaysNiceWithFS checks if the given string plays nice with filesystems.

func WriteEnvelopeToFile

func WriteEnvelopeToFile(envelope *jess.Envelope, filename string) error

WriteEnvelopeToFile serializes the envelope and writes it to the given file.

func WriteSignetToFile

func WriteSignetToFile(signet *jess.Signet, filename string) error

WriteSignetToFile serializes the signet and writes it to the given file.

Types

type DirTrustStore

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

DirTrustStore is a simple trust store using a filesystem directory as the storage backend.

func NewDirTrustStore

func NewDirTrustStore(storageDir string) (*DirTrustStore, error)

NewDirTrustStore returns a new trust store using a filesystem directory as the storage backend.

func (*DirTrustStore) AllEnvelopes

func (dts *DirTrustStore) AllEnvelopes() ([]*jess.Envelope, error)

AllEnvelopes returns all envelopes.

func (*DirTrustStore) DeleteEnvelope

func (dts *DirTrustStore) DeleteEnvelope(name string) error

DeleteEnvelope deletes the Envelope with the given name.

func (*DirTrustStore) DeleteSignet

func (dts *DirTrustStore) DeleteSignet(id string, recipient bool) error

DeleteSignet deletes the Signet or Recipient with the given ID.

func (*DirTrustStore) GetEnvelope

func (dts *DirTrustStore) GetEnvelope(name string) (*jess.Envelope, error)

GetEnvelope returns the Envelope with the given name.

func (*DirTrustStore) GetSignet

func (dts *DirTrustStore) GetSignet(id string, recipient bool) (*jess.Signet, error)

GetSignet returns the Signet with the given ID.

func (*DirTrustStore) SelectSignets

func (dts *DirTrustStore) SelectSignets(filter uint8, schemes ...string) ([]*jess.Signet, error)

SelectSignets returns a selection of the signets in the trust store. Results are filtered by tool/algorithm and whether it you're looking for a signet (private key) or a recipient (public key).

func (*DirTrustStore) StoreEnvelope

func (dts *DirTrustStore) StoreEnvelope(envelope *jess.Envelope) error

StoreEnvelope stores an Envelope.

func (*DirTrustStore) StoreSignet

func (dts *DirTrustStore) StoreSignet(signet *jess.Signet) error

StoreSignet stores a Signet in the TrustStore.

type ExtendedTrustStore

type ExtendedTrustStore interface {
	jess.TrustStore

	// StoreSignet stores a Signet.
	StoreSignet(signet *jess.Signet) error

	// DeleteSignet deletes the Signet or Recipient with the given ID.
	DeleteSignet(id string, recipient bool) error

	// SelectSignets returns a selection of the signets in the trust store. Results are filtered by tool/algorithm and whether it you're looking for a signet (private key) or a recipient (public key).
	SelectSignets(filter uint8, schemes ...string) ([]*jess.Signet, error)

	// GetEnvelope returns the Envelope with the given name.
	GetEnvelope(name string) (*jess.Envelope, error)

	// StoreEnvelope stores an Envelope.
	StoreEnvelope(envelope *jess.Envelope) error

	// DeleteEnvelope deletes the Envelope with the given name.
	DeleteEnvelope(name string) error

	// AllEnvelopes returns all envelopes.
	AllEnvelopes() ([]*jess.Envelope, error)
}

ExtendedTrustStore holds a set of trusted Signets, Recipients and Envelopes.

type KeyringTrustStore added in v0.3.0

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

KeyringTrustStore is a trust store that uses the system keyring. It does not support listing entries, so it cannot be easily managed.

func NewKeyringTrustStore added in v0.3.0

func NewKeyringTrustStore(serviceName string) (*KeyringTrustStore, error)

NewKeyringTrustStore returns a new keyring trust store with the given service name. The effect of the service name depends on the operating system. Read more at https://pkg.golang.ir/github.com/zalando/go-keyring

func (*KeyringTrustStore) AllEnvelopes added in v0.3.0

func (krts *KeyringTrustStore) AllEnvelopes() ([]*jess.Envelope, error)

AllEnvelopes returns all envelopes.

func (*KeyringTrustStore) DeleteEnvelope added in v0.3.0

func (krts *KeyringTrustStore) DeleteEnvelope(name string) error

DeleteEnvelope deletes the Envelope with the given name.

func (*KeyringTrustStore) DeleteSignet added in v0.3.0

func (krts *KeyringTrustStore) DeleteSignet(id string, recipient bool) error

DeleteSignet deletes the Signet or Recipient with the given ID.

func (*KeyringTrustStore) GetEnvelope added in v0.3.0

func (krts *KeyringTrustStore) GetEnvelope(name string) (*jess.Envelope, error)

GetEnvelope returns the Envelope with the given name.

func (*KeyringTrustStore) GetSignet added in v0.3.0

func (krts *KeyringTrustStore) GetSignet(id string, recipient bool) (*jess.Signet, error)

GetSignet returns the Signet with the given ID.

func (*KeyringTrustStore) SelectSignets added in v0.3.0

func (krts *KeyringTrustStore) SelectSignets(filter uint8, schemes ...string) ([]*jess.Signet, error)

SelectSignets returns a selection of the signets in the trust store. Results are filtered by tool/algorithm and whether it you're looking for a signet (private key) or a recipient (public key).

func (*KeyringTrustStore) StoreEnvelope added in v0.3.0

func (krts *KeyringTrustStore) StoreEnvelope(envelope *jess.Envelope) error

StoreEnvelope stores an Envelope.

func (*KeyringTrustStore) StoreSignet added in v0.3.0

func (krts *KeyringTrustStore) StoreSignet(signet *jess.Signet) error

StoreSignet stores a Signet.

Jump to

Keyboard shortcuts

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