# Messages

ACME protocol messages.

exception `acme.messages.``Error`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`, `acme.errors.Error`

  ACME error.

  https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00

  Variables:

  - typ (unicode) –
  - title (unicode) –
  - detail (unicode) –

  `description`

    Hardcoded error description based on its type.

    Returns: | Description if standard ACME error or `None`.
    Return type: | unicode

class `acme.messages.``_Constant`(name)

  Bases: `acme.jose.interfaces.JSONDeSerializable`, `_abcoll.Hashable`

  ACME constant.

class `acme.messages.``Status`(name)

  Bases: `acme.messages._Constant`

  ACME “status” field.

class `acme.messages.``IdentifierType`(name)

  Bases: `acme.messages._Constant`

  ACME identifier type.

class `acme.messages.``Identifier`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`

  ACME identifier.

  Variables:

  - typ (IdentifierType) –
  - value (unicode) –

class `acme.messages.``Directory`(jobj)

  Bases: `acme.jose.interfaces.JSONDeSerializable`

  Directory.

  classmethod `register`(resource_body_cls)

    Register resource.

class `acme.messages.``Resource`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`

  ACME Resource.

  Variables: | body (acme.messages.ResourceBody) – Resource body.

class `acme.messages.``ResourceWithURI`(**kwargs)

  Bases: `acme.messages.Resource`

  ACME Resource with URI.

  Variables: | uri (unicode) – Location of the resource.

class `acme.messages.``ResourceBody`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`

  ACME Resource Body.

class `acme.messages.``Registration`(**kwargs)

  Bases: `acme.messages.ResourceBody`

  Registration Resource Body.

  Variables:

  - key (acme.jose.jwk.JWK) – Public key.
  - contact (tuple) – Contact information following ACME spec, `tuple` of `unicode`.
  - agreement (unicode) –
  - authorizations (unicode) – URI where `messages.Registration.Authorizations` can be found.
  - certificates (unicode) – URI where `messages.Registration.Certificates` can be found.

  class `Authorizations`(**kwargs)

    Bases: `acme.jose.json_util.JSONObjectWithFields`

    Authorizations granted to Account in the process of registration.

    Variables: | authorizations (tuple) – URIs to Authorization Resources.

  class `Registration.``Certificates`(**kwargs)

    Bases: `acme.jose.json_util.JSONObjectWithFields`

    Certificates granted to Account in the process of registration.

    Variables: | certificates (tuple) – URIs to Certificate Resources.

  classmethod `Registration.``from_data`(phone=None, email=None, **kwargs)

    Create registration resource from contact details.

  `Registration.``phones`

    All phones found in the `contact` field.

  `Registration.``emails`

    All emails found in the `contact` field.

class `acme.messages.``NewRegistration`(**kwargs)

  Bases: `acme.messages.Registration`

  New registration.

class `acme.messages.``UpdateRegistration`(**kwargs)

  Bases: `acme.messages.Registration`

  Update registration.

class `acme.messages.``RegistrationResource`(**kwargs)

  Bases: `acme.messages.ResourceWithURI`

  Registration Resource.

  Variables:

  - body (acme.messages.Registration) –
  - new_authzr_uri (unicode) – URI found in the ‘next’ `Link` header
  - terms_of_service (unicode) – URL for the CA TOS.

class `acme.messages.``ChallengeBody`(**kwargs)

  Bases: `acme.messages.ResourceBody`

  Challenge Resource Body.

  Todo

  Confusingly, this has a similar name to `challenges.Challenge`, as well as `achallenges.AnnotatedChallenge`. Please use names such as `challb` to distinguish instances of this class from `achall`.

  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) –

class `acme.messages.``ChallengeResource`(**kwargs)

  Bases: `acme.messages.Resource`

  Challenge Resource.

  Variables:

  - body (acme.messages.ChallengeBody) –
  - authzr_uri (unicode) – URI found in the ‘up’ `Link` header.

class `acme.messages.``Authorization`(**kwargs)

  Bases: `acme.messages.ResourceBody`

  Authorization Resource Body.

  Variables:

  - identifier (acme.messages.Identifier) –
  - challenges (list) – `list` of `ChallengeBody`
  - combinations (tuple) – Challenge combinations (`tuple` of `tuple` of `int`, as opposed to `list` of `list` from the spec).
  - status (acme.messages.Status) –
  - expires (datetime.datetime) –

  `resolved_combinations`

    Combinations with challenges instead of indices.

class `acme.messages.``NewAuthorization`(**kwargs)

  Bases: `acme.messages.Authorization`

  New authorization.

class `acme.messages.``AuthorizationResource`(**kwargs)

  Bases: `acme.messages.ResourceWithURI`

  Authorization Resource.

  Variables:

  - body (acme.messages.Authorization) –
  - new_cert_uri (unicode) – URI found in the ‘next’ `Link` header

class `acme.messages.``CertificateRequest`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`

  ACME new-cert request.

  Variables: | csr (acme.jose.util.ComparableX509) – `OpenSSL.crypto.X509Req` wrapped in `ComparableX509`

class `acme.messages.``CertificateResource`(**kwargs)

  Bases: `acme.messages.ResourceWithURI`

  Certificate Resource.

  Variables:

  - body (acme.jose.util.ComparableX509) – `OpenSSL.crypto.X509` wrapped in `ComparableX509`
  - cert_chain_uri (unicode) – URI found in the ‘up’ `Link` header
  - authzrs (tuple) – `tuple` of `AuthorizationResource`.

class `acme.messages.``Revocation`(**kwargs)

  Bases: `acme.jose.json_util.JSONObjectWithFields`

  Revocation message.

  Variables: | certificate (ComparableX509) – `OpenSSL.crypto.X509` wrapped in `ComparableX509`