當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。