sigchain

package
v0.0.0-...-d053c91 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Hash           string
	AllowedSigners []util.AllowedSigner
	EncryptionKeys []age.Identity
	ParentHash     *string
	Signature      *string
}

func ParseSigchain

func ParseSigchain(rawSigchain []byte) ([]Entry, error)

func (*Entry) Marshal

func (entry *Entry) Marshal() (MarshalledEntry, error)

type Manager

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

func NewSigchainManager

func NewSigchainManager(ctx context.Context, dbPath string, logger *slog.Logger) (*Manager, error)

func (*Manager) AppendToSigchain

func (m *Manager) AppendToSigchain(newEntry Entry) error

TODO add functions to append to sigchain - append to sigchain (use ssh-agent for signing operation (ensure only a key allowed by the current sigchain setup is used))

func (*Manager) ApplySigchain

func (m *Manager) ApplySigchain(rawSigchain []byte) (updatedAnchors []string, err error)

ApplySigchain applies a new sigchain delta to the database.

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) GetSigchainByHash

func (m *Manager) GetSigchainByHash(hash string) ([]Entry, error)

func (*Manager) GetSigchainByNamespace

func (m *Manager) GetSigchainByNamespace(namespace string) ([]Entry, error)

type MarshalledEntry

type MarshalledEntry struct {
	AllowedSigners []util.MarshalledAllowedSigner `json:"allowed_signers"`
	EncryptionKeys []age.Identity                 `json:"encryption_keys"`
	ParentHash     *string                        `json:"parent_hash"`
	Signature      *string                        `json:"signature"`
}

func (*MarshalledEntry) GetHash

func (m *MarshalledEntry) GetHash() (string, error)

func (*MarshalledEntry) Unmarshal

func (m *MarshalledEntry) Unmarshal() (Entry, error)

type MarshalledEntryNoSig

type MarshalledEntryNoSig struct {
	AllowedSigners []util.MarshalledAllowedSigner `json:"allowed_signers"`
	ParentHash     *string                        `json:"parent_hash"`
}

Jump to

Keyboard shortcuts

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