Documentation ¶
Index ¶
- Variables
- func MarshalPrivateKey(key *PrivateKey) ([]byte, error)
- func MarshalPublicKey(key *PublicKey) ([]byte, error)
- func Sign(key *PrivateKey, data []byte) ([]byte, error)
- func SignText(key *PrivateKey, data []byte) ([]byte, error)
- func Split(msg []byte) (data, sig []byte, _ error)
- func Verify(key *PublicKey, data, sig []byte) bool
- type PrivateKey
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMessage = errors.New("pgp: invalid message")
Functions ¶
func MarshalPrivateKey ¶
func MarshalPrivateKey(key *PrivateKey) ([]byte, error)
MarshalPrivateKey returns the armored private key.
func MarshalPublicKey ¶
MarshalPublicKey returns the armored public key.
func Sign ¶
func Sign(key *PrivateKey, data []byte) ([]byte, error)
Sign signs the data with the private key.
func SignText ¶
func SignText(key *PrivateKey, data []byte) ([]byte, error)
SignText signs the data with the private key and wraps it in a signed message. Data is considered text and canonicalised with CRLF line endings.
Types ¶
type PrivateKey ¶
func NewPrivateKey ¶
func NewPrivateKey(name, email string) (*PrivateKey, error)
NewPrivateKey returns a new private key.
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(b []byte) (*PrivateKey, error)
UnmarshalPrivateKey returns a private key from an armored key.
Click to show internal directories.
Click to hide internal directories.