ACME-PYTHON(1)

NAME
acme-python - acme-python Documentation

Contents:

API DOCUMENTATION

  Challenges

ACME Identifier Validation Challenges.

class acme.challenges.Challenge(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME challenge.

TYPES:  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Type'Type link'[Challenge]] = {'dns': <class 'acme.challenges.DNS'>, 'dns-01': <class 'acme.challenges.DNS01'>, 'http-01': <class 'acme.challenges.HTTP01'>, 'tls-alpn-01': <class 'acme.challenges.TLSALPN01'>}
    Types registered for JSON deserialization

classmethod from_json(jobj:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']) -> GenericChallenge | UnrecognizedChallenge
    Deserialize ACME object from valid JSON object.

Raises
    josepy.errors.UnrecognizedTypeError -- if type of the ACME object has not been registered.

class acme.challenges.ChallengeResponse(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME challenge response.

TYPES:  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Type'Type link'[ChallengeResponse]] = {'dns': <class 'acme.challenges.DNSResponse'>, 'dns-01': <class 'acme.challenges.DNS01Response'>, 'http-01': <class 'acme.challenges.HTTP01Response'>, 'tls-alpn-01': <class 'acme.challenges.TLSALPN01Response'>}
    Types registered for JSON deserialization

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Get JSON serializable object.

Returns
    Serializable JSON object representing ACME typed object. validate() will almost certainly not work, due to reasons explained in josepy.interfaces.IJSONSerializable.

Return type
    dict

class acme.challenges.UnrecognizedChallenge(jobj:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'])
    Unrecognized challenge.

    ACME specification defines a generic framework for challenges and defines some standard challenges that are implemented in this module. However, other implementations (including peers) might define additional challenge types, which should be ignored if unrecognized.

Variables
    jobj -- Original JSON decoded object.

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Get JSON serializable object.

Returns
    Serializable JSON object representing ACME typed object. validate() will almost certainly not work, due to reasons explained in josepy.interfaces.IJSONSerializable.

Return type
    dict

classmethod from_json(jobj:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']) -> UnrecognizedChallenge
    Deserialize ACME object from valid JSON object.

Raises
    josepy.errors.UnrecognizedTypeError -- if type of the ACME object has not been registered.

class acme.challenges.KeyAuthorizationChallengeResponse(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Response to Challenges based on Key Authorization.

Parameters
    key_authorization (str)

verify(chall: KeyAuthorizationChallenge, account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Verify the key authorization.

Parameters

•   chall (KeyAuthorization) -- Challenge that corresponds to this response.

•   account_public_key (JWK)

Returns
    True iff verification of the key authorization was successful.

Return type
    bool

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Get JSON serializable object.

Returns
    Serializable JSON object representing ACME typed object. validate() will almost certainly not work, due to reasons explained in josepy.interfaces.IJSONSerializable.

Return type
    dict

class acme.challenges.KeyAuthorizationChallenge(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Challenge based on Key Authorization.

Parameters

•   response_cls -- Subclass of KeyAuthorizationChallengeResponse that will be used to generate response.

•   typ (str) -- type of the challenge

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = NotImplemented
    Type of the object. Subclasses must override.

key_authorization(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Generate Key Authorization.

Parameters
    account_key (JWK)

Rtype str

response(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') -> KeyAuthorizationChallengeResponse
    Generate response to the challenge.

Parameters
    account_key (JWK)

Returns
    Response (initialized response_cls) to the challenge.

Return type
    KeyAuthorizationChallengeResponse

abstract validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Generate validation for the challenge.

    Subclasses must implement this method, but they are likely to return completely different data structures, depending on what's necessary to complete the challenge. Interpretation of that return value must be known to the caller.

Parameters
    account_key (JWK)

Returns
    Challenge-specific validation.

response_and_validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', *args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[KeyAuthorizationChallengeResponse,  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Generate response and validation.

    Convenience function that return results of response and validation.

Parameters
    account_key (JWK)

Return type
    tuple

class acme.challenges.DNS01Response(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME dns-01 challenge response.

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'dns-01'
    Type of the object. Subclasses must override.

simple_verify(chall: DNS01, domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Simple verify.

    This method no longer checks DNS records and is a simple wrapper around KeyAuthorizationChallengeResponse.verify.

Parameters

•   chall (challenges.DNS01) -- Corresponding challenge.

•   domain (str) -- Domain name being verified.

•   account_public_key (JWK) -- Public key for the key pair being authorized.

Returns
    True iff verification of the key authorization was successful.

Return type
    bool

class acme.challenges.DNS01(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME dns-01 challenge.

response_cls
    alias of DNS01Response

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'dns-01'
    Type of the object. Subclasses must override.

LABEL = '_acme-challenge'
    Label clients prepend to the domain name being validated.

validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', **unused_kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Generate validation.

Parameters
    account_key (JWK)

Return type
    str

validation_domain_name(name:  link https://docs.python.org/3/library/stdtypes.html#str'str link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Domain name for TXT validation record.

Parameters
    name (str) -- Domain name being validated.

Return type
    str

class acme.challenges.HTTP01Response(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME http-01 challenge response.

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'http-01'
    Type of the object. Subclasses must override.

PORT = 80
    Verification port as defined by the protocol.

    You can override it (e.g. for testing) by passing port to simple_verify.

WHITESPACE_CUTSET = '\n\r\t '
    Whitespace characters which should be ignored at the end of the body.

simple_verify(chall: HTTP01, domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', port:  link https://docs.python.org/3/library/functions.html#int'int link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, timeout:  link https://docs.python.org/3/library/functions.html#int'int link' = 30) ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Simple verify.

Parameters

•   chall (challenges.SimpleHTTP) -- Corresponding challenge.

•   domain (str) -- Domain name being verified.

•   account_public_key (JWK) -- Public key for the key pair being authorized.

•   port (int) -- Port used in the validation.

•   timeout (int) -- Timeout in seconds.

Returns
    True iff validation with the files currently served by the HTTP server is successful.

Return type
    bool

class acme.challenges.HTTP01(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME http-01 challenge.

response_cls
    alias of HTTP01Response

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'http-01'
    Type of the object. Subclasses must override.

URI_ROOT_PATH = '.well-known/acme-challenge'
    URI root path for the server provisioned resource.

property path:  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Path (starting with '/') for provisioned resource.

Return type
    str

uri(domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Create an URI to the provisioned resource.

    Forms an URI to the HTTPS server provisioned resource (containing token).

Parameters
    domain (str) -- Domain name being verified.

Return type
    str

validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', **unused_kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Generate validation.

Parameters
    account_key (JWK)

Return type
    str

class acme.challenges.TLSALPN01Response(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME tls-alpn-01 challenge response.

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'tls-alpn-01'
    Type of the object. Subclasses must override.

PORT = 443
    Verification port as defined by the protocol.

    You can override it (e.g. for testing) by passing port to simple_verify.

property h:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link'
    Hash value stored in challenge certificate

gen_cert(domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', key: PKey |  link https://docs.python.org/3/library/constants.html#None'None link' = None, bits:  link https://docs.python.org/3/library/functions.html#int'int link' = 2048) ->  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[X509, PKey]
    Generate tls-alpn-01 certificate.

Parameters

•   domain (str) -- Domain verified by the challenge.

•   key (OpenSSL.crypto.PKey) -- Optional private key used in certificate generation. If not provided (None), then fresh key will be generated.

•   bits (int) -- Number of bits for newly generated key.

Return type
    tuple of OpenSSL.crypto.X509 and OpenSSL.crypto.PKey

probe_cert(domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', host:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, port:  link https://docs.python.org/3/library/functions.html#int'int link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None) -> X509
    Probe tls-alpn-01 challenge certificate.

Parameters

•   domain (str) -- domain being validated, required.

•   host (str) -- IP address used to probe the certificate.

•   port (int) -- Port used to probe the certificate.

verify_cert(domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', cert: Certificate | X509) ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Verify tls-alpn-01 challenge certificate.

Parameters

•   domain (str) -- Domain name being validated.

•   cert (cryptography.x509.Certificate or OpenSSL.crypto.X509) -- Challenge certificate.

Returns
    Whether the certificate was successfully verified.

Return type
    bool

simple_verify(chall: TLSALPN01, domain:  link https://docs.python.org/3/library/stdtypes.html#str'str link', account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', cert: X509 |  link https://docs.python.org/3/library/constants.html#None'None link' = None, host:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, port:  link https://docs.python.org/3/library/functions.html#int'int link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None) ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Simple verify.

    Verify validation using account_public_key, optionally probe tls-alpn-01 certificate and check using verify_cert.

Parameters

•   chall (.challenges.TLSALPN01) -- Corresponding challenge.

•   domain (str) -- Domain name being validated.

•   account_public_key (JWK)

•   cert (OpenSSL.crypto.X509) -- Optional certificate. If not provided (None) certificate will be retrieved using probe_cert.

•   host (string) -- IP address used to probe the certificate.

•   port (int) -- Port used to probe the certificate.

Returns
    True if and only if client's control of the domain has been verified.

Return type
    bool

class acme.challenges.TLSALPN01(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME tls-alpn-01 challenge.

response_cls
    alias of TLSALPN01Response

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'tls-alpn-01'
    Type of the object. Subclasses must override.

validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[X509, PKey]
    Generate validation.

Parameters

•   account_key (JWK)

•   domain (str) -- Domain verified by the challenge.

•   cert_key (OpenSSL.crypto.PKey) -- Optional private key used in certificate generation. If not provided (None), then fresh key will be generated.

Return type
    tuple of OpenSSL.crypto.X509 and OpenSSL.crypto.PKey

static is_supported() ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Check if TLS-ALPN-01 challenge is supported on this machine. This implies that a recent version of OpenSSL is installed (>= 1.0.2), or a recent cryptography version shipped with the OpenSSL library is installed.

Returns
    True if TLS-ALPN-01 is supported on this machine, False otherwise.

Return type
    bool

class acme.challenges.DNS(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME "dns" challenge.

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'dns'
    Type of the object. Subclasses must override.

LABEL = '_acme-challenge'
    Label clients prepend to the domain name being validated.

gen_validation(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', alg:  link https://josepy.readthedocs.io/en/latest/api/jwa.html#josepy.jwa.JWASignature'JWASignature link' = RS256, **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://josepy.readthedocs.io/en/latest/api/jws.html#josepy.jws.JWS'JWS link'
    Generate validation.

Parameters

•   account_key (.JWK) -- Private account key.

•   alg (.JWA)

Returns
    This challenge wrapped in JWS

Return type
    .JWS

check_validation(validation:  link https://josepy.readthedocs.io/en/latest/api/jws.html#josepy.jws.JWS'JWS link', account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Check validation.

Parameters

•   validation (JWS)

•   account_public_key (JWK)

Return type
    bool

gen_response(account_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> DNSResponse
    Generate response.

Parameters

•   account_key (.JWK) -- Private account key.

•   alg (.JWA)

Return type
    DNSResponse

validation_domain_name(name:  link https://docs.python.org/3/library/stdtypes.html#str'str link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Domain name for TXT validation record.

Parameters
    name (str) -- Domain name being validated.

class acme.challenges.DNSResponse(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME "dns" challenge response.

Parameters
    validation (JWS)

typ:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'dns'
    Type of the object. Subclasses must override.

check_validation(chall: DNS, account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link') ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Check validation.

Parameters

•   chall (challenges.DNS)

•   account_public_key (JWK)

Return type
    bool

  Client

ACME client API.

class acme.client.ClientV2(directory: Directory, net: ClientNetwork)
    ACME client for a v2 API.

Variables

•   directory (messages.Directory)

•   net (.ClientNetwork) -- Client network.

new_account(new_account: NewRegistration) -> RegistrationResource
    Register.

Parameters
    new_account (.NewRegistration)

Raises
    .ConflictError -- in case the account already exists

Returns
    Registration Resource.

Return type
    RegistrationResource

query_registration(regr: RegistrationResource) -> RegistrationResource
    Query server about registration.

Parameters
    regr (messages.RegistrationResource) -- Existing Registration Resource.

update_registration(regr: RegistrationResource, update: Registration |  link https://docs.python.org/3/library/constants.html#None'None link' = None) -> RegistrationResource
    Update registration.

Parameters

•   regr (messages.RegistrationResource) -- Registration Resource.

•   update (messages.Registration) -- Updated body of the resource. If not provided, body will be taken from regr.

Returns
    Updated Registration Resource.

Return type
    RegistrationResource

new_order(csr_pem:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link') -> OrderResource
    Request a new Order object from the server.

Parameters
    csr_pem (bytes) -- A CSR in PEM format.

Returns
    The newly created order.

Return type
    OrderResource

poll(authzr: AuthorizationResource) ->  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[AuthorizationResource, Response]
    Poll Authorization Resource for status.

Parameters
    authzr (AuthorizationResource) -- Authorization Resource

Returns
    Updated Authorization Resource and HTTP response.

Return type
    (AuthorizationResource, requests.Response)

poll_and_finalize(orderr: OrderResource, deadline:  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None) -> OrderResource
    Poll authorizations and finalize the order.

    If no deadline is provided, this method will timeout after 90 seconds.

Parameters

•   orderr (messages.OrderResource) -- order to finalize

•   deadline (datetime.datetime) -- when to stop polling and timeout

Returns
    finalized order

Return type
    messages.OrderResource

poll_authorizations(orderr: OrderResource, deadline:  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link') -> OrderResource
    Poll Order Resource for status.

begin_finalization(orderr: OrderResource) -> OrderResource
    Start the process of finalizing an order.

Parameters

•   orderr (messages.OrderResource) -- order to finalize

•   deadline (datetime.datetime) -- when to stop polling and timeout

Returns
    updated order

Return type
    messages.OrderResource

poll_finalization(orderr: OrderResource, deadline:  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link', fetch_alternative_chains:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False) -> OrderResource
    Poll an order that has been finalized for its status. If it becomes valid, obtain the certificate.

Returns
    finalized order (with certificate)

Return type
    messages.OrderResource

finalize_order(orderr: OrderResource, deadline:  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link', fetch_alternative_chains:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False) -> OrderResource
    Finalize an order and obtain a certificate.

Parameters

•   orderr (messages.OrderResource) -- order to finalize

•   deadline (datetime.datetime) -- when to stop polling and timeout

•   fetch_alternative_chains (bool) -- whether to also fetch alternative certificate chains

Returns
    finalized order

Return type
    messages.OrderResource

revoke(cert:  link https://josepy.readthedocs.io/en/latest/api/util.html#josepy.util.ComparableX509'ComparableX509 link', rsn:  link https://docs.python.org/3/library/functions.html#int'int link') ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Revoke certificate.

Parameters

•   cert (.ComparableX509) -- OpenSSL.crypto.X509 wrapped in ComparableX509

•   rsn (int) -- Reason code for certificate revocation.

Raises
    .ClientError -- If revocation is unsuccessful.

external_account_required() ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Checks if ACME server requires External Account Binding authentication.

classmethod get_directory(url:  link https://docs.python.org/3/library/stdtypes.html#str'str link', net: ClientNetwork) -> Directory
    Retrieves the ACME directory (RFC 8555 section 7.1.1) from the ACME server. :param str url: the URL where the ACME directory is available :param ClientNetwork net: the ClientNetwork to use to make the request

Returns
    the ACME directory object

Return type
    messages.Directory

deactivate_registration(regr: RegistrationResource) -> RegistrationResource
    Deactivate registration.

Parameters
    regr (messages.RegistrationResource) -- The Registration Resource to be deactivated.

Returns
    The Registration resource that was deactivated.

Return type
    RegistrationResource

deactivate_authorization(authzr: AuthorizationResource) -> AuthorizationResource
    Deactivate authorization.

Parameters
    authzr (messages.AuthorizationResource) -- The Authorization resource to be deactivated.

Returns
    The Authorization resource that was deactivated.

Return type
    AuthorizationResource

answer_challenge(challb: ChallengeBody, response: ChallengeResponse) -> ChallengeResource
    Answer challenge.

Parameters

•   challb (ChallengeBody) -- Challenge Resource body.

•   response (challenges.ChallengeResponse) -- Corresponding Challenge response

Returns
    Challenge Resource with updated body.

Return type
    ChallengeResource

Raises
    .UnexpectedUpdate --

classmethod retry_after(response: Response, default:  link https://docs.python.org/3/library/functions.html#int'int link') ->  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link'
    Compute next poll time based on response Retry-After header.

    Handles integers and various datestring formats per https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37

Parameters

•   response (requests.Response) -- Response from poll.

•   default (int) -- Default value (in seconds), used when Retry-After header is not present or invalid.

Returns
    Time point when next poll should be performed.

Return type
    datetime.datetime

class acme.client.ClientNetwork(key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', account: RegistrationResource |  link https://docs.python.org/3/library/constants.html#None'None link' = None, alg:  link https://josepy.readthedocs.io/en/latest/api/jwa.html#josepy.jwa.JWASignature'JWASignature link' = RS256, verify_ssl:  link https://docs.python.org/3/library/functions.html#bool'bool link' = True, user_agent:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'acme-python', timeout:  link https://docs.python.org/3/library/functions.html#int'int link' = 45)
    Wrapper around requests that signs POSTs for authentication.

    Also adds user agent, and handles Content-Type.

REPLAY_NONCE_HEADER = 'Replay-Nonce'
    Initialize.

Parameters

•   key (josepy.JWK) -- Account private key

•   account (messages.RegistrationResource) -- Account object. Required if you are planning to use .post() for anything other than creating a new account; may be set later after registering.

•   alg (josepy.JWASignature) -- Algorithm to use in signing JWS.

•   verify_ssl (bool) -- Whether to verify certificates on SSL connections.

•   user_agent (str) -- String to send as User-Agent header.

•   timeout (int) -- Timeout for requests.

head(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> Response
    Send HEAD request without checking the response.

    Note, that _check_response is not called, as it is expected that status code other than successfully 2xx will be returned, or messages2.Error will be raised by the server.

get(url:  link https://docs.python.org/3/library/stdtypes.html#str'str link', content_type:  link https://docs.python.org/3/library/stdtypes.html#str'str link' = 'application/json', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> Response
    Send GET request and check response.

post(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> Response
    POST object wrapped in JWS and check response.

    If the server responded with a badNonce error, the request will be retried once.

  Crypto_util

Crypto utilities.

class acme.crypto_util.Format(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
    File format to be used when parsing or serializing X.509 structures.

    Backwards compatible with the FILETYPE_ASN1 and FILETYPE_PEM constants from pyOpenSSL.

to_cryptography_encoding() -> Encoding
    Converts the Format to the corresponding cryptography Encoding.

class acme.crypto_util.SSLSocket(sock:  link https://docs.python.org/3/library/socket.html#socket.socket'socket link', certs:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link',  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[PKey, X509]] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, method:  link https://docs.python.org/3/library/functions.html#int'int link' = 3, alpn_selection:  link https://docs.python.org/3/library/typing.html#typing.Callable'Callable link'[[Connection,  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link']],  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, cert_selection:  link https://docs.python.org/3/library/typing.html#typing.Callable'Callable link'[[Connection],  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[PKey, X509] |  link https://docs.python.org/3/library/constants.html#None'None link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None)
    SSL wrapper for sockets.

Variables

•   sock (socket) -- Original wrapped socket.

•   certs (dict) -- Mapping from domain names (bytes) to OpenSSL.crypto.X509.

•   method -- See OpenSSL.SSL.Context for allowed values.

•   alpn_selection -- Hook to select negotiated ALPN protocol for connection.

•   cert_selection -- Hook to select certificate for connection. If given, certs parameter would be ignored, and therefore must be empty.

class FakeConnection(connection: Connection)
    Fake OpenSSL.SSL.Connection.

acme.crypto_util.probe_sni(name:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link', host:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link', port:  link https://docs.python.org/3/library/functions.html#int'int link' = 443, timeout:  link https://docs.python.org/3/library/functions.html#int'int link' = 300, method:  link https://docs.python.org/3/library/functions.html#int'int link' = 3, source_address:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/functions.html#int'int link'] = ('', 0), alpn_protocols:  link https://docs.python.org/3/library/typing.html#typing.Sequence'Sequence link'[ link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None) -> X509
    Probe SNI server for SSL certificate.

Parameters

•   name (bytes) -- Byte string to send as the server name in the client hello message.

•   host (bytes) -- Host to connect to.

•   port (int) -- Port to connect to.

•   timeout (int) -- Timeout in seconds.

•   method -- See OpenSSL.SSL.Context for allowed values.

•   source_address (tuple) -- Enables multi-path probing (selection of source interface). See socket.creation_connection for more info. Available only in Python 2.7+.

•   alpn_protocols (Sequence of bytes) -- Protocols to request using ALPN.

Raises
    acme.errors.Error -- In case of any problems.

Returns
    SSL certificate presented by the server.

Return type
    OpenSSL.crypto.X509

acme.crypto_util.make_csr(private_key_pem:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link', domains:  link https://docs.python.org/3/library/typing.html#typing.Set'Set link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link'] |  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, must_staple:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False, ipaddrs:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address'IPv4Address link' |  link https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Address'IPv6Address link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None) ->  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link'
    Generate a CSR containing domains or IPs as subjectAltNames.

    Parameters are ordered this way for backwards compatibility when called using positional arguments.

Parameters

•   private_key_pem (buffer) -- Private key, in PEM PKCS#8 format.

•   domains (list) -- List of DNS names to include in subjectAltNames of CSR.

•   must_staple (bool) -- Whether to include the TLS Feature extension (aka OCSP Must Staple: https://tools.ietf.org/html/rfc7633).

•   ipaddrs (list) -- List of IPaddress(type ipaddress.IPv4Address or ipaddress.IPv6Address) names to include in subbjectAltNames of CSR.

Returns
    buffer PEM-encoded Certificate Signing Request.

acme.crypto_util.get_names_from_subject_and_extensions(subject: Name, exts: Extensions) ->  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link']
    Gets all DNS SAN names as well as the first Common Name from subject.

Parameters

•   subject (cryptography.x509.Name) -- Name of the x509 object, which may include Common Name

•   exts (cryptography.x509.Extensions) -- Extensions of the x509 object, which may include SANs

Returns
    List of DNS Subject Alternative Names and first Common Name

Return type
    list of str

acme.crypto_util.gen_ss_cert(key: PKey, domains:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, not_before:  link https://docs.python.org/3/library/functions.html#int'int link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, validity:  link https://docs.python.org/3/library/functions.html#int'int link' = 604800, force_san:  link https://docs.python.org/3/library/functions.html#bool'bool link' = True, extensions:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[X509Extension] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, ips:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address'IPv4Address link' |  link https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Address'IPv6Address link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None) -> X509
    Generate new self-signed certificate.

Parameters

•   key (OpenSSL.crypto.PKey)

•   force_san (bool)

•   extensions (list of OpenSSL.crypto.X509Extension) -- List of additional extensions to include in the cert.

    If more than one domain is provided, all of the domains are put into subjectAltName X.509 extension and first domain is set as the subject CN. If only one domain is provided no subjectAltName extension is used, unless force_san is True.

acme.crypto_util.dump_pyopenssl_chain(chain:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://josepy.readthedocs.io/en/latest/api/util.html#josepy.util.ComparableX509'ComparableX509 link'] |  link https://docs.python.org/3/library/typing.html#typing.List'List link'[X509], filetype: Format |  link https://docs.python.org/3/library/functions.html#int'int link' = Format.PEM) ->  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link'
    Dump certificate chain into a bundle.

Parameters
    chain (list) -- List of OpenSSL.crypto.X509 (or wrapped in josepy.util.ComparableX509).

Returns
    certificate chain bundle

Return type
    bytes

  Errors

ACME errors.

exception acme.errors.Error
    Generic ACME error.

exception acme.errors.DependencyError
    Dependency error

exception acme.errors.SchemaValidationError
    JSON schema ACME object validation error.

exception acme.errors.ClientError
    Network error.

exception acme.errors.UnexpectedUpdate
    Unexpected update error.

exception acme.errors.NonceError
    Server response nonce error.

exception acme.errors.BadNonce(nonce:  link https://docs.python.org/3/library/stdtypes.html#str'str link', error:  link https://docs.python.org/3/library/exceptions.html#Exception'Exception link', *args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Bad nonce error.

exception acme.errors.MissingNonce(response: Response, *args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Missing nonce error.

    According to the specification an "ACME server MUST include an Replay-Nonce header field in each successful response to a POST it provides to a client (...)".

Variables
    ~.response (requests.Response) -- HTTP Response

exception acme.errors.PollError(exhausted:  link https://docs.python.org/3/library/typing.html#typing.Set'Set link'[messages.AuthorizationResource], updated:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[messages.AuthorizationResource, messages.AuthorizationResource])
    Generic error when polling for authorization fails.

    This might be caused by either timeout (exhausted will be non-empty) or by some authorization being invalid.

Variables

•   exhausted -- Set of AuthorizationResource that didn't finish within max allowed attempts.

•   updated -- Mapping from original AuthorizationResource to the most recently updated one

property timeout:  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Was the error caused by timeout?

exception acme.errors.ValidationError(failed_authzrs:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[messages.AuthorizationResource])
    Error for authorization failures. Contains a list of authorization resources, each of which is invalid and should have an error field.

exception acme.errors.TimeoutError
    Error for when polling an authorization or an order times out.

exception acme.errors.IssuanceError(error: messages.Error)
    Error sent by the server after requesting issuance of a certificate.

exception acme.errors.ConflictError(location:  link https://docs.python.org/3/library/stdtypes.html#str'str link')
    Error for when the server returns a 409 (Conflict) HTTP status.

    In the version of ACME implemented by Boulder, this is used to find an account if you only have the private key, but don't know the account URL.

    Also used in V2 of the ACME client for the same purpose.

exception acme.errors.WildcardUnsupportedError
    Error for when a wildcard is requested but is unsupported by ACME CA.

  Fields

ACME JSON fields.

class acme.fields.Fixed(json_name:  link https://docs.python.org/3/library/stdtypes.html#str'str link', value:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Fixed field.

decode(value:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Decode a value, optionally with context JSON object.

encode(value:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Encode a value, optionally with context JSON object.

class acme.fields.RFC3339Field(json_name:  link https://docs.python.org/3/library/stdtypes.html#str'str link', default:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link' = None, omitempty:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False, decoder:  link https://docs.python.org/3/library/typing.html#typing.Callable'Callable link'[[ link https://docs.python.org/3/library/typing.html#typing.Any'Any link'],  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, encoder:  link https://docs.python.org/3/library/typing.html#typing.Callable'Callable link'[[ link https://docs.python.org/3/library/typing.html#typing.Any'Any link'],  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None)
    RFC3339 field encoder/decoder.

    Handles decoding/encoding between RFC3339 strings and aware (not naive) datetime.datetime objects (e.g. datetime.datetime.now(pytz.UTC)).

classmethod default_encoder(value:  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link') ->  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    Default (passthrough) encoder.

classmethod default_decoder(value:  link https://docs.python.org/3/library/stdtypes.html#str'str link') ->  link https://docs.python.org/3/library/datetime.html#datetime.datetime'datetime link'
    Default decoder.

    Recursively deserialize into immutable types ( josepy.util.frozendict instead of dict(), tuple() instead of list()).

acme.fields.fixed(json_name:  link https://docs.python.org/3/library/stdtypes.html#str'str link', value:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Generates a type-friendly Fixed field.

acme.fields.rfc3339(json_name:  link https://docs.python.org/3/library/stdtypes.html#str'str link', omitempty:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False) ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Generates a type-friendly RFC3339 field.

  JOSE

The acme.jose module was moved to its own package "josepy". Please refer to its documentation there.

  JWS

ACME-specific JWS.

The JWS implementation in josepy only implements the base JOSE standard. In order to support the new header fields defined in ACME, this module defines some ACME-specific classes that layer on top of josepy.

class acme.jws.Header(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME-specific JOSE Header. Implements nonce, kid, and url.

class acme.jws.Signature(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME-specific Signature. Uses ACME-specific Header for customer fields.

header_cls
    alias of Header

class acme.jws.JWS(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME-specific JWS. Includes none, url, and kid in protected header.

signature_cls
    alias of Signature

classmethod sign(payload:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link', key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', alg:  link https://josepy.readthedocs.io/en/latest/api/jwa.html#josepy.jwa.JWASignature'JWASignature link', nonce:  link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link' |  link https://docs.python.org/3/library/constants.html#None'None link', url:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, kid:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None) ->  link https://josepy.readthedocs.io/en/latest/api/jws.html#josepy.jws.JWS'JWS link'
    Sign.

  Messages

ACME protocol messages.

acme.messages.is_acme_error(err:  link https://docs.python.org/3/library/exceptions.html#BaseException'BaseException link') ->  link https://docs.python.org/3/library/functions.html#bool'bool link'
    Check if argument is an ACME error.

class acme.messages.IdentifierType(name:  link https://docs.python.org/3/library/stdtypes.html#str'str link')
    ACME identifier type.

class acme.messages.Identifier(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME identifier.

Variables

•   typ (IdentifierType)

•   value (str)

exception acme.messages.Error(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME error.

    https://datatracker.ietf.org/doc/html/rfc7807

    Note: Although Error inherits from JSONObjectWithFields, which is immutable, we add mutability for Error to comply with the Python exception API.

Variables

•   typ (str)

•   title (str)

•   detail (str)

•   identifier (Identifier)

•   subproblems (tuple) -- An array of ACME Errors which may be present when the CA returns multiple errors related to the same request, tuple of Error.

classmethod with_code(code:  link https://docs.python.org/3/library/stdtypes.html#str'str link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> Error
    Create an Error instance with an ACME Error code.

Str code
    An ACME error code, like 'dnssec'.

Kwargs
    kwargs to pass to Error.

property description:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link'
    Hardcoded error description based on its type.

Returns
    Description if standard ACME error or None.

Return type
    str

property code:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link'
    ACME error code.

    Basically self.typ without the ERROR_PREFIX.

Returns
    error code if standard ACME code or None.

Return type
    str

class acme.messages.Status(name:  link https://docs.python.org/3/library/stdtypes.html#str'str link')
    ACME "status" field.

class acme.messages.Directory(jobj:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'])
    Directory.

    Directory resources must be accessed by the exact field name in RFC8555 (section 9.7.5).

class Meta(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Directory Meta.

property terms_of_service:  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    URL for the CA TOS

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Partially serialize.

    Following the example, partial serialization means the following:

        assert isinstance(Bar().to_partial_json()[0], Foo)
        assert isinstance(Bar().to_partial_json()[1], Foo)
        # in particular...
        assert Bar().to_partial_json() != ['foo', 'foo']

Raises
    josepy.errors.SerializationError -- in case of any serialization error.

Returns
    Partially serializable object.

classmethod from_json(jobj:  link https://docs.python.org/3/library/typing.html#typing.MutableMapping'MutableMapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']) -> Directory
    Deserialize a decoded JSON document.

Parameters
    jobj -- Python object, composed of only other basic data types, as decoded from JSON document. Not necessarily dict (as decoded from "JSON object" document).

Raises
    josepy.errors.DeserializationError -- if decoding was unsuccessful, e.g. in case of unparseable X509 certificate, or wrong padding in JOSE base64 encoded string, etc.

class acme.messages.Resource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME Resource.

Variables
    body (acme.messages.ResourceBody) -- Resource body.

class acme.messages.ResourceWithURI(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME Resource with URI.

Variables
    uri (str) -- Location of the resource.

class acme.messages.ResourceBody(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME Resource Body.

class acme.messages.ExternalAccountBinding
    ACME External Account Binding

classmethod from_data(account_public_key:  link https://josepy.readthedocs.io/en/latest/api/jwk.html#josepy.jwk.JWK'JWK link', kid:  link https://docs.python.org/3/library/stdtypes.html#str'str link', hmac_key:  link https://docs.python.org/3/library/stdtypes.html#str'str link', directory: Directory) ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Create External Account Binding Resource from contact details, kid and hmac.

class acme.messages.Registration(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Registration Resource Body.

Variables

•   key (jose.JWK) -- Public key.

•   contact (tuple) -- Contact information following ACME spec, tuple of str.

•   agreement (str)

classmethod from_data(phone:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, email:  link https://docs.python.org/3/library/stdtypes.html#str'str link' |  link https://docs.python.org/3/library/constants.html#None'None link' = None, external_account_binding:  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'] |  link https://docs.python.org/3/library/constants.html#None'None link' = None, **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') -> GenericRegistration
    Create registration resource from contact details.

    The contact keyword being passed to a Registration object is meaningful, so this function represents empty iterables in its kwargs by passing on an empty tuple.

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Modify josepy.JSONDeserializable.to_partial_json()

fields_to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Modify josepy.JSONObjectWithFields.fields_to_partial_json()

property phones:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link', ...]
    All phones found in the contact field.

property emails:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link', ...]
    All emails found in the contact field.

class acme.messages.NewRegistration(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    New registration.

class acme.messages.UpdateRegistration(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Update registration.

class acme.messages.RegistrationResource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Registration Resource.

Variables

•   body (acme.messages.Registration)

•   new_authzr_uri (str) -- Deprecated. Do not use.

•   terms_of_service (str) -- URL for the CA TOS.

class acme.messages.ChallengeBody(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Challenge Resource Body.

Variables

•   acme.challenges.Challenge -- Wrapped challenge. Conveniently, all challenge fields are proxied, i.e. you can call challb.x to get challb.chall.x contents.

•   status (acme.messages.Status)

•   validated (datetime.datetime)

•   error (messages.Error)

encode(name:  link https://docs.python.org/3/library/stdtypes.html#str'str link') ->  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'
    Encode a single field.

Parameters
    name (str) -- Name of the field to be encoded.

Raises

•   errors.SerializationError -- if field cannot be serialized

•   errors.Error -- if field could not be found

to_partial_json() ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Partially serialize.

    Following the example, partial serialization means the following:

        assert isinstance(Bar().to_partial_json()[0], Foo)
        assert isinstance(Bar().to_partial_json()[1], Foo)
        # in particular...
        assert Bar().to_partial_json() != ['foo', 'foo']

Raises
    josepy.errors.SerializationError -- in case of any serialization error.

Returns
    Partially serializable object.

classmethod fields_from_json(jobj:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']) ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Deserialize fields from JSON.

property uri:  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    The URL of this challenge.

class acme.messages.ChallengeResource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Challenge Resource.

Variables

•   body (acme.messages.ChallengeBody)

•   authzr_uri (str) -- URI found in the 'up' Link header.

property uri:  link https://docs.python.org/3/library/stdtypes.html#str'str link'
    The URL of the challenge body.

class acme.messages.Authorization(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Authorization Resource Body.

Variables

•   identifier (acme.messages.Identifier)

•   challenges (list) -- list of ChallengeBody

•   status (acme.messages.Status)

•   expires (datetime.datetime)

class acme.messages.NewAuthorization(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    New authorization.

class acme.messages.UpdateAuthorization(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Update authorization.

class acme.messages.AuthorizationResource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Authorization Resource.

Variables

•   body (acme.messages.Authorization)

•   new_cert_uri (str) -- Deprecated. Do not use.

class acme.messages.CertificateRequest(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    ACME newOrder request.

Variables
    csr (jose.ComparableX509) -- OpenSSL.crypto.X509Req wrapped in ComparableX509

class acme.messages.CertificateResource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Certificate Resource.

Variables

•   body (josepy.util.ComparableX509) -- OpenSSL.crypto.X509 wrapped in ComparableX509

•   cert_chain_uri (str) -- URI found in the 'up' Link header

•   authzrs (tuple) -- tuple of AuthorizationResource.

class acme.messages.Revocation(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Revocation message.

Variables
    certificate (jose.ComparableX509) -- OpenSSL.crypto.X509 wrapped in jose.ComparableX509

class acme.messages.Order(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Order Resource Body.

Variables

•   identifiers (list of Identifier) -- List of identifiers for the certificate.

•   status (acme.messages.Status)

•   authorizations (list of str) -- URLs of authorizations.

•   certificate (str) -- URL to download certificate as a fullchain PEM.

•   finalize (str) -- URL to POST to to request issuance once all authorizations have "valid" status.

•   expires (datetime.datetime) -- When the order expires.

•   error (Error) -- Any error that occurred during finalization, if applicable.

class acme.messages.OrderResource(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Order Resource.

Variables

•   body (acme.messages.Order)

•   csr_pem (bytes) -- The CSR this Order will be finalized with.

•   authorizations (list of acme.messages.AuthorizationResource) -- Fully-fetched AuthorizationResource objects.

•   fullchain_pem (str) -- The fetched contents of the certificate URL produced once the order was finalized, if it's present.

•   alternative_fullchains_pem (list of str) -- The fetched contents of alternative certificate chain URLs produced once the order was finalized, if present and requested during finalization.

class acme.messages.NewOrder(**kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    New order.

  Standalone

Support for standalone client challenge solvers.

class acme.standalone.TLSServer(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Generic TLS Server.

server_bind() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Called by constructor to bind the socket.

    May be overridden.

class acme.standalone.ACMEServerMixin
    ACME server common settings mixin.

class acme.standalone.BaseDualNetworkedServers(ServerClass:  link https://docs.python.org/3/library/typing.html#typing.Type'Type link'[ link https://docs.python.org/3/library/socketserver.html#socketserver.TCPServer'TCPServer link'], server_address:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/functions.html#int'int link'], *remaining_args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Base class for a pair of IPv6 and IPv4 servers that tries to do everything it's asked for both servers, but where failures in one server don't affect the other.

    If two servers are instantiated, they will serve on the same port.

serve_forever() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Wraps socketserver.TCPServer.serve_forever

getsocknames() ->  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/functions.html#int'int link']]
    Wraps socketserver.TCPServer.socket.getsockname

shutdown_and_server_close() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Wraps socketserver.TCPServer.shutdown, socketserver.TCPServer.server_close, and threading.Thread.join

class acme.standalone.TLSALPN01Server(server_address:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/functions.html#int'int link'], certs:  link https://docs.python.org/3/library/typing.html#typing.List'List link'[ link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[PKey, X509]], challenge_certs:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/stdtypes.html#bytes'bytes link',  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[PKey, X509]], ipv6:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False)
    TLSALPN01 Server.

class acme.standalone.HTTPServer(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    Generic HTTP Server.

class acme.standalone.HTTP01Server(server_address:  link https://docs.python.org/3/library/typing.html#typing.Tuple'Tuple link'[ link https://docs.python.org/3/library/stdtypes.html#str'str link',  link https://docs.python.org/3/library/functions.html#int'int link'], resources:  link https://docs.python.org/3/library/typing.html#typing.Set'Set link'[HTTP01], ipv6:  link https://docs.python.org/3/library/functions.html#bool'bool link' = False, timeout:  link https://docs.python.org/3/library/functions.html#int'int link' = 30)
    HTTP01 Server.

class acme.standalone.HTTP01DualNetworkedServers(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    HTTP01Server Wrapper. Tries everything for both. Failures for one don't affect the other.

class acme.standalone.HTTP01RequestHandler(*args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link', **kwargs:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link')
    HTTP01 challenge handler.

    Adheres to the stdlib's socketserver.BaseRequestHandler interface.

Variables
    simple_http_resources (set) -- A set of HTTP01Resource objects. TODO: better name?

class HTTP01Resource(chall, response, validation)

chall
    Alias for field number 0

response
    Alias for field number 1

validation
    Alias for field number 2

property timeout:  link https://docs.python.org/3/library/functions.html#int'int link'
    The default timeout this server should apply to requests. :return: timeout to apply :rtype: int

log_message(format:  link https://docs.python.org/3/library/stdtypes.html#str'str link', *args:  link https://docs.python.org/3/library/typing.html#typing.Any'Any link') ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Log arbitrary message.

handle() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Handle request.

handle_index() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Handle index page.

handle_404() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Handler 404 Not Found errors.

handle_simple_http_resource() ->  link https://docs.python.org/3/library/constants.html#None'None link'
    Handle HTTP01 provisioned resources.

classmethod partial_init(simple_http_resources:  link https://docs.python.org/3/library/typing.html#typing.Set'Set link'[HTTP01], timeout:  link https://docs.python.org/3/library/functions.html#int'int link') -> partial[HTTP01RequestHandler]
    Partially initialize this handler.

    This is useful because socketserver.BaseServer takes uninitialized handler and initializes it with the current request.

  Util

ACME utilities.

acme.util.map_keys(dikt:  link https://docs.python.org/3/library/typing.html#typing.Mapping'Mapping link'[ link https://docs.python.org/3/library/typing.html#typing.Any'Any link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link'], func:  link https://docs.python.org/3/library/typing.html#typing.Callable'Callable link'[[ link https://docs.python.org/3/library/typing.html#typing.Any'Any link'],  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']) ->  link https://docs.python.org/3/library/typing.html#typing.Dict'Dict link'[ link https://docs.python.org/3/library/typing.html#typing.Any'Any link',  link https://docs.python.org/3/library/typing.html#typing.Any'Any link']
    Map dictionary keys.

    ACME protocol implementation.

    This module is an implementation of the ACME protocol.

•   Index

•   Module Index

•   Search Page

AUTHOR
Let's Encrypt Project

COPYRIGHT
2015, Let's Encrypt Project