konnect.curl.certificates.encodings module
Classes for various DER encoded objects, with ASCII armoring and file storage for them
- class AsciiArmored[source]
Bases:
bytesBase 64 encoding with fences for binary cryptographic data, commonly known as PEM
This class assumes that the encoded data contains at most one certificate and one private key, the first occurrence of each being returned by the
AsciiArmored.certificate()andAsciiArmored.private_key()methods respectively.- format: ClassVar = 'PEM'
- classmethod new(certificate: konnect.curl.certificates.encodings.Certificate | None = None, private_key: konnect.curl.certificates.encodings.PrivateKey | None = None) Self[source]
Return an instance with the encoded form of the given certificate and/or private key
- classmethod from_bytes(source: bytes, /) Self[source]
Return a new instance from an in-memory bytes string
- to_bytes() Self[source]
Return a bytes string representation of an instance (itself, as it subclasses bytes)
- certificate() konnect.curl.certificates.encodings.Certificate | None[source]
Return the first certificate found in the encoded data, or None
- private_key() konnect.curl.certificates.encodings.PrivateKey | None[source]
Return the first private key found in the encoded data
- find_first(kind: type[konnect.curl.certificates.encodings.Certificate], /) konnect.curl.certificates.encodings.Certificate[source]
- find_first(kind: type[PrivateKeyT], /) PrivateKeyT
Return the first item with a label matching one of the provided types
- class Certificate[source]
Bases:
bytesX.509 certificates
- format: ClassVar = 'DER'
- label: ClassVar = 'CERTIFICATE'
- classmethod from_bytes(source: bytes, /) Self[source]
Return a new instance from an in-memory bytes string
- class ECPrivateKey(source: bytes, /)[source]
Bases:
konnect.curl.certificates.encodings.PrivateKeyECDSA private key
- class Pkcs8EncryptedPrivateKey(source: bytes, /)[source]
Bases:
konnect.curl.certificates.encodings.PrivateKeyPKCS#8 encrypted private key
- class Pkcs8PrivateKey(source: bytes, /)[source]
Bases:
konnect.curl.certificates.encodings.PrivateKeyPKCS#8 unencrypted private key
- class Pkcs12[source]
Bases:
bytesAn ASN.1 container format for cryptographic data
- format: ClassVar = 'P12'
- classmethod new(certificate: konnect.curl.certificates.encodings.Certificate | None = None, private_key: konnect.curl.certificates.encodings.PrivateKey | None = None) Self[source]
Return an instance with the encoded form of the given certificate and/or private key
- classmethod from_bytes(source: bytes, /) Self[source]
Return a new instance from an in-memory bytes string
- to_bytes() Self[source]
Return a bytes string representation of an instance (itself, as it subclasses bytes)
- certificate() konnect.curl.certificates.encodings.Certificate | None[source]
Return the first certificate found in the encoded data
- private_key() konnect.curl.certificates.encodings.PrivateKey | None[source]
Return the first private key found in the encoded data
- class PrivateKey(source: bytes, /)[source]
Bases:
bytesBase class for private key containers
- classmethod from_bytes(source: bytes, /) Self[source]
Return a new instance from an in-memory bytes string