Example #1
0
 def test_unknown_extension_str(self):
     asn1 = rfc5280.Extension()
     asn1['extnID'] = univ.ObjectIdentifier('1.2.3.4')
     asn1['critical'] = False
     asn1['extnValue'] = "foobar"
     ext = extension.X509Extension(asn1)
     self.assertEqual("1.2.3.4: <unknown>", str(ext))
Example #2
0
 def test_invalid_asn(self):
     with self.assertRaises(errors.X509Error):
         extension.X509Extension("foobar")
Example #3
0
 def test_no_spec(self):
     with self.assertRaises(errors.X509Error):
         extension.X509Extension()