Exemplo n.º 1
0
 def test_nid(self):
     assert m2.obj_ln2nid("commonName") == m2.obj_txt2nid(
         "2.5.4.3"), "ln2nid and txt2nid mismatch"
     assert m2.obj_ln2nid("CN") == 0, "ln2nid on sn"
     assert m2.obj_sn2nid("CN") == m2.obj_ln2nid(
         "commonName"), "ln2nid and sn2nid mismatch"
     assert m2.obj_sn2nid("CN") == m2.obj_obj2nid(m2.obj_txt2obj(
         "CN", 0)), "obj2nid"
     assert m2.obj_txt2nid("__unknown") == 0, "__unknown"
Exemplo n.º 2
0
 def test_nid(self):
     self.assertEqual(m2.obj_ln2nid("commonName"),
                      m2.obj_txt2nid("2.5.4.3"),
                      "ln2nid and txt2nid mismatch")
     self.assertEqual(m2.obj_ln2nid("CN"), 0, "ln2nid on sn")
     self.assertEqual(m2.obj_sn2nid("CN"), m2.obj_ln2nid("commonName"),
                      "ln2nid and sn2nid mismatch")
     self.assertEqual(m2.obj_sn2nid("CN"),
                      m2.obj_obj2nid(m2.obj_txt2obj("CN", 0)), "obj2nid")
     self.assertEqual(m2.obj_txt2nid("__unknown"), 0, "__unknown")
Exemplo n.º 3
0
 def test_nid(self):
     self.assertEqual(m2.obj_ln2nid("commonName"),
                      m2.obj_txt2nid("2.5.4.3"),
                      "ln2nid and txt2nid mismatch")
     self.assertEqual(m2.obj_ln2nid("CN"),
                      0, "ln2nid on sn")
     self.assertEqual(m2.obj_sn2nid("CN"),
                      m2.obj_ln2nid("commonName"),
                      "ln2nid and sn2nid mismatch")
     self.assertEqual(m2.obj_sn2nid("CN"),
                      m2.obj_obj2nid(m2.obj_txt2obj("CN", 0)), "obj2nid")
     self.assertEqual(m2.obj_txt2nid("__unknown"),
                      0, "__unknown")
Exemplo n.º 4
0
def available_curves():
    bc_dict = EC.get_builtin_curves()
    bin_curves = set(x['sname'] for x in bc_dict)
    out_curves = tuple(
        (m2.obj_sn2nid(x[0]), x[1]) for x in curves if x[0] in bin_curves)
    return out_curves
Exemplo n.º 5
0
 def test_nid(self):
     assert m2.obj_ln2nid("commonName") == m2.obj_txt2nid("2.5.4.3"), "ln2nid and txt2nid mismatch"
     assert m2.obj_ln2nid("CN") == 0, "ln2nid on sn"
     assert m2.obj_sn2nid("CN") == m2.obj_ln2nid("commonName"), "ln2nid and sn2nid mismatch"
     assert m2.obj_sn2nid("CN") == m2.obj_obj2nid(m2.obj_txt2obj("CN", 0)), "obj2nid"
     assert m2.obj_txt2nid("__unknown") == 0, "__unknown"
Exemplo n.º 6
0
def available_curves():
    bc_dict = EC.get_builtin_curves()
    bin_curves = set(x['sname'] for x in bc_dict)
    out_curves = tuple((m2.obj_sn2nid(x[0]), x[1]) for x in curves
                       if x[0] in bin_curves)
    return out_curves