Beispiel #1
0
 def setUp(self):
     from acme.challenges import SimpleHTTP
     self.msg = SimpleHTTP(token=jose.decode_b64jose(
         'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA'))
     self.jmsg = {
         'type': 'simpleHttp',
         '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',
     }
Beispiel #3
0
 def setUp(self):
     from acme.challenges import HTTP01
     self.msg = HTTP01(token=jose.decode_b64jose(
         'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA'))
     self.jmsg = {
         'type': 'http-01',
         'token': 'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA',
     }
Beispiel #4
0
 def setUp(self):
     from acme.challenges import SimpleHTTP
     self.msg = SimpleHTTP(
         token=jose.decode_b64jose(
             'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA'))
     self.jmsg = {
         'type': 'simpleHttp',
         'token': 'evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA',
     }
Beispiel #5
0
    def setUp(self):
        from acme.challenges import DVSNIResponse
        # pylint: disable=invalid-name
        s = '9dbjsl3gTAtOnEtKFEmhS6Mj-ajNjDcOmRkp3Lfzm3c'
        self.msg = DVSNIResponse(s=jose.decode_b64jose(s))
        self.jmsg = {
            'resource': 'challenge',
            'type': 'dvsni',
            's': s,
        }

        from acme.challenges import DVSNI
        self.chall = DVSNI(
            r=jose.decode_b64jose('Tyq0La3slT7tqQ0wlOiXnCY2vyez7Zo5blgPJ1xt5xI'),
            nonce=jose.decode_b64jose('a82d5ff8ef740d12881f6d3c2277ab2e'))
        self.z = (b'38e612b0397cc2624a07d351d7ef50e4'
                  b'6134c0213d9ed52f7d7c611acaeed41b')
        self.domain = 'foo.com'
        self.key = test_util.load_pyopenssl_private_key('rsa512_key.pem')
        self.public_key = test_util.load_rsa_private_key(
            'rsa512_key.pem').public_key()
    def setUp(self):
        from acme.challenges import DVSNIResponse
        # pylint: disable=invalid-name
        s = '9dbjsl3gTAtOnEtKFEmhS6Mj-ajNjDcOmRkp3Lfzm3c'
        self.msg = DVSNIResponse(s=jose.decode_b64jose(s))
        self.jmsg = {
            'resource': 'challenge',
            'type': 'dvsni',
            's': s,
        }

        from acme.challenges import DVSNI
        self.chall = DVSNI(
            r=jose.decode_b64jose(
                'Tyq0La3slT7tqQ0wlOiXnCY2vyez7Zo5blgPJ1xt5xI'),
            nonce=jose.decode_b64jose('a82d5ff8ef740d12881f6d3c2277ab2e'))
        self.z = (b'38e612b0397cc2624a07d351d7ef50e4'
                  b'6134c0213d9ed52f7d7c611acaeed41b')
        self.domain = 'foo.com'
        self.key = test_util.load_pyopenssl_private_key('rsa512_key.pem')
        self.public_key = test_util.load_rsa_private_key(
            'rsa512_key.pem').public_key()
Beispiel #7
0
def decode_csr(b64der):
    """
    Decode JOSE Base-64 DER-encoded CSR.

    :param str b64der: The encoded CSR.

    :rtype: `cryptography.x509.CertificateSigningRequest`
    :return: The decoded CSR.
    """
    try:
        return x509.load_der_x509_csr(jose.decode_b64jose(b64der),
                                      default_backend())
    except ValueError as error:
        raise DeserializationError(error)
Beispiel #8
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))
Beispiel #9
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))
Beispiel #10
0
def InvalidateAuth(challenge_uri, challenge_token):
	HTTPChallenge = challenges.HTTP01(token=jose.decode_b64jose(challenge_token))
	authorization = HTTPChallenge.validation(KEY)
	HTTPChallengeResponse = challenges.HTTP01Response(key_authorization=authorization)
	challenge_body = messages.ChallengeBody(chall=HTTPChallenge,uri=challenge_uri)
	answer = ACME_CLIENT.answer_challenge(challenge_body,HTTPChallengeResponse)
    def setUp(self):
        from acme.challenges import HTTP01

        self.msg = HTTP01(token=jose.decode_b64jose("evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA"))
        self.jmsg = {"type": "http-01", "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"}