Пример #1
0
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         self.assertTrue(False)
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         self.assertIn(c, (cert1, cert2))
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         assert False
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         assert c in (cert1, cert2)
Пример #3
0
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         self.assertTrue(False)
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         self.assertIn(c, (cert1, cert2))
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     with pytest.raises(SecurityError):
         certstore.add_cert(cert1)
Пример #5
0
 def _get_s(self, key, cert, certs):
     store = CertStore()
     for c in certs:
         store.add_cert(Certificate(c))
     return SecureSerializer(PrivateKey(key), Certificate(cert), store)
Пример #6
0
 def _get_s(self, key, cert, certs):
     store = CertStore()
     for c in certs:
         store.add_cert(Certificate(c))
     return SecureSerializer(PrivateKey(key), Certificate(cert), store)
Пример #7
0
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     self.assertRaises(SecurityError, certstore.add_cert, cert1)
Пример #8
0
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     self.assertRaises(SecurityError, certstore.add_cert, cert1)