Skip to main content

Module pem

Module pem 

Source
Expand description

PEM armor: base64 encoding with -----BEGIN/END ...----- headers.

Functions§

base64_decode
Decode a base64 string. Returns None on invalid input.
base64_encode
Encode data as base64.
pem_decode
Decode a PEM block with the expected label. Returns the DER bytes. Returns None if the label doesn’t match or base64 is invalid.
pem_encode
Encode DER bytes as PEM with the given label (e.g. “RSA PUBLIC KEY”).