ssl.PEM_cert_to_DER_cert
Prev: ssl.Options | Up: ssl | Next: ssl.Purpose
Rel: ssl.AlertDescription, ssl.cert_time_to_seconds, ssl.CertificateError, ssl.create_connection
Ref: docs.python.org — ssl.PEM_cert_to_DER_cert
Tags: #public #python3 #stdlib #ssl
Import
import ssl
from ssl import PEM_cert_to_DER_cert
Signature & Overview
ssl.PEM_cert_to_DER_cert(pem_cert_string)
Takes a certificate in ASCII PEM format and returns the DER-encoded version of it as a byte sequence
Usage
import ssl
pem = "-----BEGIN CERTIFICATE-----\nMAA=\n-----END CERTIFICATE-----\n"
assert ssl.PEM_cert_to_DER_cert(pem) == b"\x30\x00"
Gotchas
- Expects a single PEM
str(notbytes) with exact-----BEGIN CERTIFICATE-----/-----END CERTIFICATE-----markers.
REPL Inspect
from ssl import PEM_cert_to_DER_cert
help(PEM_cert_to_DER_cert)
Linked from
Related notes
- tuts/python3/stdlib_module/ssl/Options Linked here; links to this page; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/Purpose Linked here; links to this page; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ssl/AlertDescription Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/cert_time_to_seconds Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/CertificateError Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/create_connection Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/create_default_context shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/DefaultVerifyPaths shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/DER_cert_to_PEM_cert shared tags: #ssl, #stdlib