Utilities

JOSE utilities.

class acme.jose.util.abstractclassmethod(target)[source]

Bases: classmethod

Descriptor for an abstract classmethod.

It augments the abc framework with an abstract classmethod. This is implemented as abc.abstractclassmethod in the standard Python library starting with version 3.2.

This particular implementation, allegedly based on Python 3.3 source code, is stolen from http://stackoverflow.com/questions/11217878/python-2-7-combine-abc-abstractmethod-and-classmethod.

class acme.jose.util.ComparableX509(wrapped)[source]

Bases: object

Wrapper for OpenSSL.crypto.X509** objects that supports __eq__.

Variables:wrapped – Wrapped certificate or certificate request.
_dump(filetype=2)[source]

Dumps the object into a buffer with the specified encoding.

Parameters:filetype (int) – The desired encoding. Should be one of OpenSSL.crypto.FILETYPE_ASN1, OpenSSL.crypto.FILETYPE_PEM, or OpenSSL.crypto.FILETYPE_TEXT.
Returns:Encoded X509 object.
Return type:str
class acme.jose.util.ComparableKey(wrapped)[source]

Bases: object

Comparable wrapper for cryptography keys.

See https://github.com/pyca/cryptography/issues/2122.

public_key()[source]

Get wrapped public key.

class acme.jose.util.ComparableRSAKey(wrapped)[source]

Bases: acme.jose.util.ComparableKey

Wrapper for cryptography RSA keys.

Wraps around: - cryptography.hazmat.primitives.asymmetric.RSAPrivateKey - cryptography.hazmat.primitives.asymmetric.RSAPublicKey

class acme.jose.util.ImmutableMap(**kwargs)[source]

Bases: collections.abc.Mapping, collections.abc.Hashable

Immutable key to value mapping with attribute access.

update(**kwargs)[source]

Return updated map.

class acme.jose.util.frozendict(*args, **kwargs)[source]

Bases: collections.abc.Mapping, collections.abc.Hashable

Frozen dictionary.