clearsign

package
v0.0.0-...-2f677ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package clearsign generates and processes OpenPGP, clear-signed data. See RFC 4880, section 7.

Clearsigned messages are cryptographically signed, but the contents of the message are kept in plaintext so that it can be read without special tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

type Block

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
}

A Block represents a clearsigned message. A signature on a Block can be checked by passing Bytes into openpgp.CheckDetachedSignature.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL