app

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsistentSnapshot = true

Enable consistent snapshotting.

View Source
var DefaultThreshold = 3

Threshold for root and targets signers.

View Source
var RoleExpiration = map[string][]int{
	"root":      {0, 6, 0},
	"targets":   {0, 6, 0},
	"snapshot":  {0, 0, 21},
	"timestamp": {0, 0, 7},
}

Time to role expiration represented as a list of ints corresponding to (years, months, days).

Functions

func AddDelegation

func AddDelegation() *ffcli.Command

func ClearEmptySignatures

func ClearEmptySignatures(store tuf.LocalStore, role string) error

func DelegationCmd

func DelegationCmd(ctx context.Context, opts *DelegationOptions) error

func DoKeyPOPSign

func DoKeyPOPSign(ctx context.Context,
	challenge, nonce string,
	signer signature.Signer) ([]byte, error)

func GetExpiration

func GetExpiration(role string) time.Time

func GetKeyIDForRole

func GetKeyIDForRole(directory, role string) (string, error)

func GetPublicKeyFromID

func GetPublicKeyFromID(directory, keyid string) (crypto.PublicKey, error)

func GetSigner

func GetSigner(ctx context.Context, sk bool, keyRef string) (signature.Signer, error)

func GetVerifier

func GetVerifier(_ context.Context, keyRef string) (signature.Verifier, error)

func Init

func Init() *ffcli.Command

func InitCmd

func InitCmd(ctx context.Context, directory string,
	threshold int, targetsConfig *prepo.TargetMetaConfig,
	targetsDir string,
	snapshotRef string, timestampRef string) error

InitCmd creates a new staged root.json and targets.json in the specified directory. It populates the top-level roles with signers and adds targets to top-level targets.

  • directory: Directory to write newly staged metadata. Must contain a keys/ subdirectory with root/targets signers.
  • threshold: The root and targets threshold.
  • targetsConfig: A map of target file names and custom metadata to add to top-level targets. Target file names are expected to be in the working directory.
  • targetsDir: The local directory where the targets are stored.
  • snapshotRef: A reference (KMS, file, URL) to a snapshot signer.
  • timestampRef: A reference (KMS, file, URL) to a timestamp signer.

The root and targets metadata will be initialized with a 6 month expiration. Revoked keys will be automatically calculated given the previous root and the signers in directory. Signature placeholders for each key will be added to the root.json and targets.json file.

func KeyPOPSign

func KeyPOPSign() *ffcli.Command

func KeyPOPSignCmd

func KeyPOPSignCmd(ctx context.Context,
	challenge, nonce string,
	signer signature.Signer) error

func KeyPOPVerify

func KeyPOPVerify() *ffcli.Command

func KeyPOPVerifyCmd

func KeyPOPVerifyCmd(ctx context.Context,
	challenge, nonce string,
	verifier signature.Verifier,
	sig []byte) error

func PAE

func PAE(challenge, nonce string) []byte

The DSSE Pre-Authentication Encoding https://github.com/secure-systems-lab/dsse/blob/master/protocol.md#signature-definition

func Publish

func Publish() *ffcli.Command

func PublishCmd

func PublishCmd(_ context.Context, directory string) error

func Snapshot

func Snapshot() *ffcli.Command

func SnapshotCmd

func SnapshotCmd(_ context.Context, directory string) error

func Timestamp

func Timestamp() *ffcli.Command

func TimestampCmd

func TimestampCmd(_ context.Context, directory string) error

Types

type DelegationOptions

type DelegationOptions struct {
	Directory   string
	Name        string
	Path        string
	Terminating bool
	KeyRefs     []string
	Threshold   int
	Targets     string
}

Jump to

Keyboard shortcuts

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