Ejemplo n.º 1
0
    def test_get_created_none(self):
        created = None
        cert = x_509.X509(self.data,
                          self.name,
                          created)

        self.assertEqual(created, cert.created)
Ejemplo n.º 2
0
    def test___eq__(self):
        self.assertTrue(self.cert == self.cert)
        self.assertTrue(self.cert is self.cert)

        self.assertFalse(self.cert is None)
        self.assertFalse(None == self.cert)

        other_x_509 = x_509.X509(self.data)
        self.assertTrue(self.cert == other_x_509)
        self.assertFalse(self.cert is other_x_509)
def _get_test_certificate():
    data = bytes(utils.get_certificate_der())
    cert = x_509.X509(data)
    return cert
Ejemplo n.º 4
0
 def test___ne___data(self):
     other_x509 = x_509.X509(b'\x00\x00\x00', self.name)
     self.assertTrue(self.cert != other_x509)
Ejemplo n.º 5
0
 def _create_cert(self):
     return x_509.X509(self.data,
                       self.name,
                       self.created)
 def test___ne__name(self):
     other_x509 = x_509.X509(self.data, "other x509")
     self.assertTrue(self.cert != other_x509)