Skip to content

loadCertificate

Canonical path: o6.util.loadCertificate

loadCertificate

loadCertificate(path)

Load a DER- or PEM-encoded certificate from path.

The bytes are passed through unchanged, so the format is whatever the file holds. Client.config and the Server constructor accept a path directly, so this is only needed when the same material is reused in several places.

Parameters:

Name Type Description Default
path str | Path

File to read.

required

Returns:

Type Description
bytes

The raw certificate bytes.

Raises:

Type Description
OSError

The file cannot be read.