Go to the latest version of this document.

# ``twisted`.`protocols`.`_sni`.`PEMObjects``

class documentation

`class PEMObjects: (source)`

Constructors: `PEMObjects.fromDirectory(directory)`, `PEMObjects.fromFile(fp)`

View In Hierarchy

A collection of objects loaded from a collection of PEM-encoded files.

Class Method | `fromDirectory` | Walk through the given directory looking for files with a `.pem` extension, and instantiate a `PEMObjects` containing all certificates and key pairs from those files.
Class Method | `fromFile` | Load some objects from the lines of a single PEM file.
Method | `inferDomainMapping` | Return a mapping of DNS name to `CertificateOptions`.
Class Variable | `_certificates` | A list of pairs of (FilePath, Certificate) that indicates what files contain what certificates.
Class Variable | `_keyPairs` | A list of pairs of (FilePath, KeyPair) that indicates what pairs contain what certificates.

@classmethod
def fromDirectory(cls, directory: `FilePath[str]`) -> `PEMObjects`: (source)

Walk through the given directory looking for files with a `.pem` extension, and instantiate a `PEMObjects` containing all certificates and key pairs from those files.

Parameters
directory:`FilePath[str]` | a `FilePath` pointing at a directory in the filesystem which may contain some PEM files.

Returns
`PEMObjects` | Undocumented

@classmethod
def fromFile(cls, fp: `FilePath[str]`) -> `PEMObjects`: (source)

Load some objects from the lines of a single PEM file.

Parameters
fp:`FilePath[str]` | A `FilePath` pointing at a file on the filesystem whose contents should be PEM data.

Returns
`PEMObjects` | Undocumented

def inferDomainMapping(self) -> `dict[str, CertificateOptions]`: (source)

Return a mapping of DNS name to `CertificateOptions`.

_certificates: `list[tuple[FilePath[str], Certificate]]` = (source)

A list of pairs of (FilePath, Certificate) that indicates what files contain what certificates.

_keyPairs: `list[tuple[FilePath[str], KeyPair]]` = (source)

A list of pairs of (FilePath, KeyPair) that indicates what pairs contain what certificates.