Esempio n. 1
0
 def setUp(self):
     from acme.challenges import DNS01
     self.msg = DNS01(token=jose.decode_b64jose(
         'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA'))
     self.jmsg = {
         'type': 'dns-01',
         'token': 'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA',
     }
 def setUp(self):
     from acme.challenges import DNS01
     self.msg = DNS01(token=jose.decode_b64jose(
         'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA'))
     self.jmsg = {
         'type': 'dns-01',
         'token': 'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA',
     }
Esempio n. 3
0
def parse_acme_csr(value: str) -> x509.CertificateSigningRequest:
    """Convert the CSR as received via ACMEv2 into a valid CSR.

    ACMEv2 sends the CSR as a base64url encoded string of its DER /ASN.1 representation.

    Returns
    -------

    :py:class:`~cg:cryptography.x509.CertificateSigningRequest`
        The CSR as used by cryptography.
    """
    decoded = jose.decode_b64jose(value)
    return x509.load_der_x509_csr(decoded, default_backend())
Esempio n. 4
0
 def nonce(value):  # pylint: disable=missing-docstring,no-self-argument
     try:
         return jose.decode_b64jose(value)
     except jose.DeserializationError as error:
         # TODO: custom error
         raise jose.DeserializationError("Invalid nonce: {0}".format(error))
Esempio n. 5
0
 def nonce(value: str) -> bytes:  # type: ignore[misc]  # pylint: disable=no-self-argument,missing-function-docstring
     try:
         return jose.decode_b64jose(value)
     except jose.DeserializationError as error:
         # TODO: custom error
         raise jose.DeserializationError("Invalid nonce: {0}".format(error))
Esempio n. 6
0
 def nonce(value):  # pylint: disable=missing-docstring,no-self-argument
     try:
         return jose.decode_b64jose(value)
     except jose.DeserializationError as error:
         # TODO: custom error
         raise jose.DeserializationError("Invalid nonce: {0}".format(error))