keys

package
v0.0.0-...-af40d72 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: Apache-2.0, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongType        = errors.New("tuf: invalid key type")
	ErrExists           = errors.New("tuf: key already in db")
	ErrWrongID          = errors.New("tuf: key id mismatch")
	ErrInvalidKey       = errors.New("tuf: invalid key")
	ErrInvalidKeyID     = errors.New("tuf: invalid key id")
	ErrInvalidThreshold = errors.New("tuf: invalid role threshold")
)

Various basic key database errors

Functions

This section is empty.

Types

type KeyDB

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

KeyDB is an in memory database of public keys and role associations. It is populated when parsing TUF files and used during signature verification to look up the keys for a given role

func NewDB

func NewDB() *KeyDB

NewDB initializes an empty KeyDB

func (*KeyDB) AddKey

func (db *KeyDB) AddKey(k data.PublicKey)

AddKey adds a public key to the database

func (*KeyDB) AddRole

func (db *KeyDB) AddRole(r *data.Role) error

AddRole adds a role to the database. Any keys associated with the role must have already been added.

func (*KeyDB) GetKey

func (db *KeyDB) GetKey(id string) data.PublicKey

GetKey pulls a key out of the database by its ID

func (*KeyDB) GetRole

func (db *KeyDB) GetRole(name string) *data.Role

GetRole retrieves a role based on its name

Jump to

Keyboard shortcuts

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