Documentation
¶
Overview ¶
Package signed contains (1) convenience functions for ECDSA private and public key handling, and for signing and verifying byte slices with ECDSA; (2) functions for marshaling structs to signed bytes, and verifying and unmarshaling signed bytes back to structs.
Index ¶
- Variables
- func GenerateKey() (*ecdsa.PrivateKey, error)
- func MarshalPemPrivateKey(sk *ecdsa.PrivateKey) ([]byte, error)
- func MarshalPemPublicKey(pk *ecdsa.PublicKey) ([]byte, error)
- func MarshalPrivateKey(sk *ecdsa.PrivateKey) ([]byte, error)
- func MarshalPublicKey(pk *ecdsa.PublicKey) ([]byte, error)
- func Sign(sk *ecdsa.PrivateKey, bts []byte) ([]byte, error)
- func UnmarshalPemPrivateKey(bts []byte) (*ecdsa.PrivateKey, error)
- func UnmarshalPemPublicKey(bts []byte) (*ecdsa.PublicKey, error)
- func UnmarshalPrivateKey(bts []byte) (*ecdsa.PrivateKey, error)
- func UnmarshalPublicKey(bts []byte) (*ecdsa.PublicKey, error)
- func UnmarshalVerify(pk *ecdsa.PublicKey, signed Message, dst interface{}) error
- func Verify(pk *ecdsa.PublicKey, bts []byte, signature []byte) error
- type Message
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSignature = errors.New("ecdsa signature was invalid")
Functions ¶
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, error)
func MarshalPemPrivateKey ¶
func MarshalPemPrivateKey(sk *ecdsa.