当前位置: 首页>>代码示例>>Python>>正文


Python messages.CertificateRequest类代码示例

本文整理汇总了Python中acme.messages.CertificateRequest的典型用法代码示例。如果您正苦于以下问题:Python CertificateRequest类的具体用法?Python CertificateRequest怎么用?Python CertificateRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CertificateRequest类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CertificateRequestTest

class CertificateRequestTest(unittest.TestCase):
    """Tests for acme.messages.CertificateRequest."""

    def setUp(self):
        from acme.messages import CertificateRequest
        self.req = CertificateRequest(csr=CSR)

    def test_json_de_serializable(self):
        self.assertTrue(isinstance(self.req, jose.JSONDeSerializable))
        from acme.messages import CertificateRequest
        self.assertEqual(
            self.req, CertificateRequest.from_json(self.req.to_json()))
开发者ID:g1franc,项目名称:lets-encrypt-preview,代码行数:12,代码来源:messages_test.py

示例2: CertificateRequestTest

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 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'].to_json()

    def test_create(self):
        from 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_partial_json(self):
        self.assertEqual(self.msg.to_partial_json(), self.jmsg_to)

    def test_from_json(self):
        from acme.messages import CertificateRequest
        self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg_from))
开发者ID:QuantumGhost,项目名称:lets-encrypt-preview,代码行数:37,代码来源:messages_test.py

示例3: setUp

    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 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'].to_json()
开发者ID:QuantumGhost,项目名称:lets-encrypt-preview,代码行数:19,代码来源:messages_test.py

示例4: test_json_de_serializable

 def test_json_de_serializable(self):
     self.assertTrue(isinstance(self.req, jose.JSONDeSerializable))
     from acme.messages import CertificateRequest
     self.assertEqual(
         self.req, CertificateRequest.from_json(self.req.to_json()))
开发者ID:g1franc,项目名称:lets-encrypt-preview,代码行数:5,代码来源:messages_test.py

示例5: setUp

 def setUp(self):
     from acme.messages import CertificateRequest
     self.req = CertificateRequest(csr=CSR)
开发者ID:g1franc,项目名称:lets-encrypt-preview,代码行数:3,代码来源:messages_test.py

示例6: setUp

 def setUp(self):
     from acme.messages import CertificateRequest
     self.req = CertificateRequest(csr=CSR, authorizations=('foo',))
开发者ID:ruo91,项目名称:letsencrypt,代码行数:3,代码来源:messages_test.py

示例7: test_from_json

 def test_from_json(self):
     from acme.messages import CertificateRequest
     self.assertEqual(self.msg, CertificateRequest.from_json(self.jmsg_from))
开发者ID:QuantumGhost,项目名称:lets-encrypt-preview,代码行数:3,代码来源:messages_test.py

示例8: test_create

 def test_create(self):
     from 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'))
开发者ID:QuantumGhost,项目名称:lets-encrypt-preview,代码行数:5,代码来源:messages_test.py


注:本文中的acme.messages.CertificateRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。