Documentation ¶
Overview ¶
Package signature provides support for digital signature algorithms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm uint8
Algorithm represents a digital signature algorithm.
The various digital signature schemes that are currently supported.
func AlgorithmFromString ¶
type KeyPair ¶
type KeyPair interface { Algorithm() Algorithm PrivateKey() PrivateKey PublicKey() PublicKey Sign(data []byte) (sig []byte) Value() []byte Verify(data []byte, sig []byte) bool }
KeyPair represents the combined public/private keypair for a digital signature algorithm.
func GenKeyPair ¶
GenKeyPair generates a new keypair for the given digital signature algorithm. It uses crypto/rand's Reader behind the scenes as the source of randomness.
type PrivateKey ¶
PrivateKey represents the private key for a digital signature algorithm. It can be used to sign data that can be verified by holders of the corresponding public key.
func LoadPrivateKey ¶
func LoadPrivateKey(s Algorithm, value []byte) (PrivateKey, error)
LoadPrivateKey deserialises the given value into a type implementing the PrivateKey interface for the given digital signature algorithm.