Documentation ¶
Index ¶
- Variables
- func Unmarshal(b []byte, v interface{}, role string, minVersion int, db *DB) error
- func UnmarshalTrusted(b []byte, v interface{}, role string, db *DB) error
- func ValidRole(name string) bool
- type DB
- func (db *DB) AddKey(id string, k *data.Key) error
- func (db *DB) AddRole(name string, r *data.Role) error
- func (db *DB) GetKey(id string) *data.Key
- func (db *DB) GetRole(name string) *Role
- func (db *DB) Verify(s *data.Signed, role string, minVersion int) error
- func (db *DB) VerifySignatures(s *data.Signed, role string) error
- type ErrExpired
- type ErrLowVersion
- type Role
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingKey = errors.New("tuf: missing key") ErrNoSignatures = errors.New("tuf: data has no signatures") ErrInvalid = errors.New("tuf: signature verification failed") ErrWrongMethod = errors.New("tuf: invalid signature type") ErrUnknownRole = errors.New("tuf: unknown role") ErrRoleThreshold = errors.New("tuf: valid signatures did not meet threshold") ErrWrongMetaType = errors.New("tuf: meta file has wrong 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") )
View Source
var Verifiers = map[string]Verifier{ data.KeyTypeEd25519: ed25519Verifier{}, data.KeyTypeECDSA_SHA2_P256: p256Verifier{}, }
Verifiers is used to map key types to Verifier instances.
Functions ¶
Types ¶
type ErrExpired ¶
func (ErrExpired) Error ¶
func (e ErrExpired) Error() string
type ErrLowVersion ¶
func (ErrLowVersion) Error ¶
func (e ErrLowVersion) Error() string
type Verifier ¶
type Verifier interface { // Verify takes a key, message and signature, all as byte slices, // and determines whether the signature is valid for the given // key and message. Verify(key, msg, sig []byte) error // ValidKey returns true if the provided public key is valid and usable to // verify signatures with this verifier. ValidKey([]byte) bool }
A Verifier verifies public key signatures.
Click to show internal directories.
Click to hide internal directories.