ca

package module
v0.0.0-...-d40ca63 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChecksumInvalid = errors.New("Invalid checksum")
	ErrClosed          = errors.New("Handle is closed")
)

Functions

This section is empty.

Types

type Handle

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

Handle for exclusive access to a Merkle Tree CA state.

func New

func New(path string, opts NewOpts) (*Handle, error)

Creates a new Merkle Tree CA, and opens it.

Call Handle.Close() when done.

func Open

func Open(path string) (*Handle, error)

Load private state of Merkle Tree CA, and acquire lock.

Call Handle.Close() when done.

func (*Handle) Close

func (ca *Handle) Close() error

func (*Handle) Issue

func (h *Handle) Issue() error

Issue queued assertions into new batch.

Drops batches that fall outside of storage window.

func (*Handle) Params

func (ca *Handle) Params() mtc.CAParams

func (*Handle) Queue

func (h *Handle) Queue(a mtc.Assertion, checksum []byte) error

Queue assertion for publication.

If checksum is not nil, makes sure assertion matches the checksum.

func (*Handle) QueueMultiple

func (h *Handle) QueueMultiple(it func(yield func(qa QueuedAssertion) error) error) error

Queue multiple assertions for publication.

For each entry, if checksum is not nil, makes sure the assertion matches the checksum

func (*Handle) WalkQueue

func (h *Handle) WalkQueue(f func(QueuedAssertion) error) error

Calls f on each assertion queued to be published.

type NewOpts

type NewOpts struct {
	IssuerId   string
	HttpServer string

	SignatureScheme mtc.SignatureScheme
	BatchDuration   time.Duration
	Lifetime        time.Duration
	StorageDuration time.Duration
}

type QueuedAssertion

type QueuedAssertion struct {
	Checksum  []byte
	Assertion mtc.Assertion
}

func (*QueuedAssertion) MarshalBinary

func (a *QueuedAssertion) MarshalBinary() ([]byte, error)

func (*QueuedAssertion) UnmarshalBinary

func (a *QueuedAssertion) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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