Ejemplo n.º 1
0
 def test_basic_constraints_not_critical(self):
     csr = signing_request.X509Csr()
     ext = extension.X509ExtensionBasicConstraints()
     ext.set_critical(False)
     csr.add_extension(ext)
     with self.assertRaises(errors.ValidationError):
         standards._critical_flags(csr)
Ejemplo n.º 2
0
 def test_no_subject_san_critical(self):
     csr = signing_request.X509Csr()
     ext = extension.X509ExtensionSubjectAltName()
     ext.set_critical(True)
     ext.add_dns_id('example.com')
     csr.add_extension(ext)
     standards._critical_flags(csr)
Ejemplo n.º 3
0
 def test_no_subject_san_not_critical(self):
     csr = signing_request.X509Csr()
     ext = extension.X509ExtensionSubjectAltName()
     ext.set_critical(False)
     ext.add_dns_id('example.com')
     csr.add_extension(ext)
     with self.assertRaises(errors.ValidationError):
         standards._critical_flags(csr)
Ejemplo n.º 4
0
 def test_with_subject_san_not_critical(self):
     csr = signing_request.X509Csr()
     subject = name.X509Name()
     subject.add_name_entry(name.OID_commonName, "example.com")
     csr.set_subject(subject)
     ext = extension.X509ExtensionSubjectAltName()
     ext.set_critical(False)
     ext.add_dns_id('example.com')
     csr.add_extension(ext)
     standards._critical_flags(csr)
Ejemplo n.º 5
0
 def test_basic_constraints_critical(self):
     csr = signing_request.X509Csr()
     ext = extension.X509ExtensionBasicConstraints()
     ext.set_critical(True)
     csr.add_extension(ext)
     standards._critical_flags(csr)