keys

package
v0.0.0-...-82ed859 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2016 License: BSD-3-Clause Imports: 4 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")
	ErrInvalidRole      = errors.New("tuf: invalid role")
	ErrInvalidKeyID     = errors.New("tuf: invalid key id")
	ErrInvalidThreshold = errors.New("tuf: invalid role threshold")
)

Functions

func ValidRole

func ValidRole(name string) bool

Types

type DB

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

func NewDB

func NewDB() *DB

func (*DB) AddKey

func (db *DB) AddKey(id string, k *data.Key) error

func (*DB) AddRole

func (db *DB) AddRole(name string, r *data.Role) error

func (*DB) GetKey

func (db *DB) GetKey(id string) *Key

func (*DB) GetRole

func (db *DB) GetRole(name string) *Role

type Key

type Key struct {
	ID      string
	Public  [ed25519.PublicKeySize]byte
	Private *[ed25519.PrivateKeySize]byte
}

func NewKey

func NewKey() (*Key, error)

func (*Key) Serialize

func (k *Key) Serialize() *data.Key

func (*Key) SerializePrivate

func (k *Key) SerializePrivate() *data.Key

type Role

type Role struct {
	KeyIDs    map[string]struct{}
	Threshold int
}

func (*Role) ValidKey

func (r *Role) ValidKey(id string) bool

Jump to

Keyboard shortcuts

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