xref: /plan9/sys/man/8/pem (revision aa46331b3112ae4dc6baa1d3328ee098fe7870d1)
PEM 8
NAME
pemdecode, pemencode - encode files in Privacy Enhanced Mail (PEM) format
SYNOPSIS

auth/pemdecode section [ file ]

auth/pemencode section [ file ]

DESCRIPTION
PEM is a textual encoding for binary data originally used by the Privacy Enhanced Mail program but now commonly used for other applications, notably TLS. PEM encodes data in base 64 (see encode (2)) between lines of the form:
.EX -----BEGIN SECTION----- -----END SECTION-----

where SECTION may be any string describing the encoded data. The most common use of PEM format on Plan 9 is for encoding X.509 certificates; see rsa (8).

Pemdecode extracts the named section and writes the decoded data to standard output.

Pemencode encodes its standard input, labels it as a section , and writes it to standard output.

EXAMPLES
Encode and decode a simple greeting:
.EX % echo hello world | auth/pemencode GREETING -----BEGIN GREETING----- aGVsbG8gd29ybGQK -----END GREETING----- % echo hello world | auth/pemencode GREETING | auth/pemdecode GREETING hello world %
SOURCE
/sys/src/cmd/auth
"SEE ALSO
rsa (8)