...
Package clearsign
Overview ▹
Index ▹
func Encode ¶
func Encode(w io.Writer, privateKey *packet.PrivateKey, config *packet.Config) (plaintext io.WriteCloser, err error)
Encode returns a WriteCloser which will clear-sign a message with privateKey and write it to w. If config is nil, sensible defaults are used.
type Block ¶
A Block represents a clearsigned message. A signature on a Block can be checked by passing Bytes into openpgp.CheckDetachedSignature.
type Block struct { Headers textproto.MIMEHeader // Optional message headers Plaintext []byte // The original message text Bytes []byte // The signed message ArmoredSignature *armor.Block // The signature block }
func Decode ¶
func Decode(data []byte) (b *Block, rest []byte)
Decode finds the first clearsigned message in data and returns it, as well as the suffix of data which remains after the message.