コード例 #1
0
 def test_create(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.assertEqual(
         self.msg,
         CertificateRequest.create(
             csr=CSR,
             key=KEY,
             sig_nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9'))
コード例 #2
0
    def setUp(self):
        signature = other.Signature(
            alg='RS256',
            jwk=jose.JWK(key=KEY.publickey()),
            sig='\x15\xed\x84\xaa:\xf2DO\x0e9 \xbcg\xf8\xc0\xcf\x87\x9a'
            '\x95\xeb\xffT[\x84[\xec\x85\x7f\x8eK\xe9\xc2\x12\xc8Q'
            '\xafo\xc6h\x07\xba\xa6\xdf\xd1\xa7"$\xba=Z\x13n\x14\x0b'
            'k\xfe\xee\xb4\xe4\xc8\x05\x9a\x08\xa7',
            nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9')

        from letsencrypt.acme.messages import CertificateRequest
        self.msg = CertificateRequest(csr=CSR, signature=signature)

        self.jmsg = {
            'type': 'certificateRequest',
            'csr': jose.b64encode(CSR.as_der()),
            'signature': signature,
        }
コード例 #3
0
class CertificateRequestTest(unittest.TestCase):
    def setUp(self):
        signature = other.Signature(
            alg=jose.RS256,
            jwk=jose.JWKRSA(key=KEY.publickey()),
            sig='\x15\xed\x84\xaa:\xf2DO\x0e9 \xbcg\xf8\xc0\xcf\x87\x9a'
            '\x95\xeb\xffT[\x84[\xec\x85\x7f\x8eK\xe9\xc2\x12\xc8Q'
            '\xafo\xc6h\x07\xba\xa6\xdf\xd1\xa7"$\xba=Z\x13n\x14\x0b'
            'k\xfe\xee\xb4\xe4\xc8\x05\x9a\x08\xa7',
            nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9')

        from letsencrypt.acme.messages import CertificateRequest
        self.msg = CertificateRequest(csr=CSR, signature=signature)

        self.jmsg_to = {
            'type': 'certificateRequest',
            'csr': jose.b64encode(CSR.as_der()),
            'signature': signature,
        }
        self.jmsg_from = self.jmsg_to.copy()
        self.jmsg_from['signature'] = self.jmsg_from[
            'signature'].fully_serialize()

    def test_create(self):
        from letsencrypt.acme.messages import CertificateRequest
        self.assertEqual(
            self.msg,
            CertificateRequest.create(
                csr=CSR,
                key=KEY,
                sig_nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9'))

    def test_verify(self):
        self.assertTrue(self.msg.verify())

    def test_to_json(self):
        self.assertEqual(self.msg.to_json(), self.jmsg_to)

    def test_from_json(self):
        from letsencrypt.acme.messages import CertificateRequest
        self.assertEqual(self.msg,
                         CertificateRequest.from_json(self.jmsg_from))
コード例 #4
0
class CertificateRequestTest(unittest.TestCase):

    def setUp(self):
        signature = other.Signature(
            alg=jose.RS256, jwk=jose.JWKRSA(key=KEY.publickey()),
            sig='\x15\xed\x84\xaa:\xf2DO\x0e9 \xbcg\xf8\xc0\xcf\x87\x9a'
                '\x95\xeb\xffT[\x84[\xec\x85\x7f\x8eK\xe9\xc2\x12\xc8Q'
                '\xafo\xc6h\x07\xba\xa6\xdf\xd1\xa7"$\xba=Z\x13n\x14\x0b'
                'k\xfe\xee\xb4\xe4\xc8\x05\x9a\x08\xa7',
            nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9')

        from letsencrypt.acme.messages import CertificateRequest
        self.msg = CertificateRequest(csr=CSR, signature=signature)

        self.jmsg_to = {
            'type': 'certificateRequest',
            'csr': jose.b64encode(CSR.as_der()),
            'signature': signature,
        }
        self.jmsg_from = self.jmsg_to.copy()
        self.jmsg_from['signature'] = self.jmsg_from[
            'signature'].fully_serialize()

    def test_create(self):
        from letsencrypt.acme.messages import CertificateRequest
        self.assertEqual(self.msg, CertificateRequest.create(
            csr=CSR, key=KEY,
            sig_nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9'))

    def test_verify(self):
        self.assertTrue(self.msg.verify())

    def test_to_json(self):
        self.assertEqual(self.msg.to_json(), self.jmsg_to)

    def test_from_json(self):
        from letsencrypt.acme.messages import CertificateRequest
        self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg_from))
コード例 #5
0
    def setUp(self):
        signature = other.Signature(
            alg='RS256', jwk=jose.JWK(key=KEY.publickey()),
            sig='\x15\xed\x84\xaa:\xf2DO\x0e9 \xbcg\xf8\xc0\xcf\x87\x9a'
                '\x95\xeb\xffT[\x84[\xec\x85\x7f\x8eK\xe9\xc2\x12\xc8Q'
                '\xafo\xc6h\x07\xba\xa6\xdf\xd1\xa7"$\xba=Z\x13n\x14\x0b'
                'k\xfe\xee\xb4\xe4\xc8\x05\x9a\x08\xa7',
            nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9')

        from letsencrypt.acme.messages import CertificateRequest
        self.msg = CertificateRequest(csr=CSR, signature=signature)

        self.jmsg = {
            'type': 'certificateRequest',
            'csr': jose.b64encode(CSR.as_der()),
            'signature': signature,
        }
コード例 #6
0
 def test_from_json(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg_from))
コード例 #7
0
 def test_from_json(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg_from))
コード例 #8
0
 def test_create(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.assertEqual(self.msg, CertificateRequest.create(
         csr=CSR, key=KEY,
         sig_nonce='\xec\xd6\xf2oYH\xeb\x13\xd5#q\xe0\xdd\xa2\x92\xa9'))
コード例 #9
0
 def test_from_json(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.jmsg['signature'] = self.jmsg['signature'].to_json()
     self.jmsg['signature']['jwk'] = self.jmsg['signature']['jwk'].to_json()
     self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg))
コード例 #10
0
 def test_from_json(self):
     from letsencrypt.acme.messages import CertificateRequest
     self.jmsg['signature'] = self.jmsg['signature'].to_json()
     self.jmsg['signature']['jwk'] = self.jmsg['signature']['jwk'].to_json()
     self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg))