Documentation ¶
Index ¶
- Variables
- func Marshal(v interface{}, keys ...*data.Key) (*data.Signed, error)
- func RegisterVerifier(name string, v Verifier)
- func Sign(s *data.Signed, k *data.Key)
- func Unmarshal(b []byte, v interface{}, role string, minVersion int, db *keys.DB) error
- func UnmarshalTrusted(b []byte, v interface{}, role string, db *keys.DB) error
- func Verify(s *data.Signed, role string, minVersion int, db *keys.DB) error
- func VerifySignatures(s *data.Signed, role string, db *keys.DB) error
- type Ed25519Verifier
- type ErrExpired
- type ErrLowVersion
- type RSAVerifier
- 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") ErrWrongType = errors.New("tuf: meta file has wrong type") )
View Source
var Verifiers = map[string]Verifier{ "ed25519": Ed25519Verifier{}, }
Verifiers is used to map algorithm names to Verifier instances.
Functions ¶
func RegisterVerifier ¶
RegisterVerifier provides a convenience function for init() functions to register additional verifiers or replace existing ones.
func UnmarshalTrusted ¶
Types ¶
type Ed25519Verifier ¶
type Ed25519Verifier struct{}
Ed25519Verifier is an implementation of a Verifier that verifies ed25519 signatures
type ErrExpired ¶
func (ErrExpired) Error ¶
func (e ErrExpired) Error() string
type ErrLowVersion ¶
func (ErrLowVersion) Error ¶
func (e ErrLowVersion) Error() string
type RSAVerifier ¶
type RSAVerifier struct{}
RSAVerifier is an implementation of a Verifier that verifies RSA signatures. N.B. Currently not covered by unit tests, use at your own risk.
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 []byte, msg []byte, sig []byte) error }
Verifier describes the verification interface. Implement this interface to add additional verifiers to go-tuf.
Click to show internal directories.
Click to hide internal directories.