Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrWrongKeyType occurs when a key is not an valid key type. ErrWrongKeyType = errors.New("not an valid key type") // ErrPointNotOnCurve occurs when a public key is not on the curve. ErrPointNotOnCurve = errors.New("point is not on the P256 curve") // ErrMissingSig occurs when the Verify function is called with a nil signature. ErrMissingSig = errors.New("missing signature") // ErrNoPEMFound occurs when attempting to parse a non PEM data structure. ErrNoPEMFound = errors.New("no PEM block found") // ErrSign occurs whenever signature generation fails. ErrSign = errors.New("signature generation failed") // ErrVerify occurs whenever signature verification fails. ErrVerify = errors.New("signature verification failed") // ErrUnimplemented occurs when a signature scheme is not implemented. ErrUnimplemented = errors.New("scheme is unimplemented") // Rand is the PRNG reader. It can be overwritten in tests. Rand = rand.Reader )
Functions ¶
Types ¶
type Signer ¶
type Signer interface { // Sign generates a digital signature object. Sign(interface{}) (*sigpb.DigitallySigned, error) // PublicKey returns the signer public key as tpb.PublicKey proto // message. PublicKey() (*tpb.PublicKey, error) // KeyID returns the ID of the associated public key. KeyID() string // Marshal marshals a signer object into a keymaster SigningKey message. PrivateKeyPEM() ([]byte, error) // PublicKeyPEM returns the PEM-formatted public key of this signer. PublicKeyPEM() ([]byte, error) }
Signer represents an object that can generate signatures with a single key.
type Verifier ¶
type Verifier interface { // Verify checks the digital signature associated applied to data. Verify(interface{}, *sigpb.DigitallySigned) error // PublicKey returns the verifier public key as tpb.PublicKey proto // message. PublicKey() (*tpb.PublicKey, error) // KeyID returns the ID of the associated public key. KeyID() string // PublicKeyPEM marshals a verifier object into a keymaster VerifyingKey message. PublicKeyPEM() ([]byte, error) }
Verifier represents an object that can verify signatures with a single key.
Click to show internal directories.
Click to hide internal directories.