package armor
Import Path
golang.org/x/crypto/openpgp/armor (on go.dev)
Dependency Relation
imports 5 packages, and imported by one package
Involved Source Files
Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is
very similar to PEM except that it has an additional CRC checksum.
encode.go
Package-Level Type Names (total 5, in which 1 are exported)
A Block represents an OpenPGP armored structure.
The encoded form is:
-----BEGIN Type-----
Headers
base64-encoded Bytes
'=' base64 encoded checksum
-----END Type-----
where Headers is a possibly empty sequence of Key: Value lines.
Since the armored data can be very large, this package presents a streaming
interface.
// A Reader from which the contents can be read
// Optional headers.
// The type, taken from the preamble (i.e. "PGP SIGNATURE").
lReader lineReader
oReader openpgpReader
func Decode(in io.Reader) (p *Block, err error)
Package-Level Functions (total 5, in which 2 are exported)
Decode reads a PGP armored block from the given Reader. It will ignore
leading garbage. If it doesn't find a block, it will return nil, io.EOF. The
given Reader is not usable after calling this function: an arbitrary amount
of data may have been read past the end of the block.
Encode returns a WriteCloser which will encode the data written to it in
OpenPGP armor.
Package-Level Variables (total 8, in which 1 are exported)
Package-Level Constants (total 3, none are exported)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |