Exemple #1
0
    def testItShouldHaveACAAfterLoading(self):
        old_ca = CA()
        old_ca.create_ca()

        key_pem = CA.pkey_to_pem(old_ca.ca_key)
        cert_pem = CA.certificate_to_pem(old_ca.ca_cert)

        ca = CA()
        ca.load(key_pem, cert_pem)

        assert ca.has_ca()
Exemple #2
0
 def testItShouldHaveACAAfterLoading(self):
     old_ca = CA()
     old_ca.create_ca()
     
     key_pem = CA.pkey_to_pem(old_ca.ca_key)
     cert_pem = CA.certificate_to_pem(old_ca.ca_cert)
     
     ca = CA()
     ca.load(key_pem, cert_pem)
     
     assert ca.has_ca()
Exemple #3
0
    def testItShouldLoadACA(self):
        old_ca = CA()
        old_ca.create_ca()

        key_pem = CA.pkey_to_pem(old_ca.ca_key)
        cert_pem = CA.certificate_to_pem(old_ca.ca_cert)

        ca = CA()
        assert ca.load(key_pem, cert_pem)
Exemple #4
0
 def testItShouldLoadACA(self):
     old_ca = CA()
     old_ca.create_ca()
     
     key_pem = CA.pkey_to_pem(old_ca.ca_key)
     cert_pem = CA.certificate_to_pem(old_ca.ca_cert)
     
     ca = CA()
     assert ca.load(key_pem, cert_pem)
Exemple #5
0
    def testItShouldNotLoadACAFromInvalidKeyMaterial(self):
        old_ca = CA()
        old_ca.create_ca()

        key_pem = CA.pkey_to_pem(old_ca.ca_key)

        old_ca.create_ca()

        cert_pem = CA.certificate_to_pem(old_ca.ca_cert)

        ca = CA()
        assert not ca.load(key_pem, cert_pem)
        assert not ca.has_ca()
Exemple #6
0
 def testItShouldNotLoadACAFromInvalidKeyMaterial(self):
     old_ca = CA()
     old_ca.create_ca()
     
     key_pem = CA.pkey_to_pem(old_ca.ca_key)
     
     old_ca.create_ca()
     
     cert_pem = CA.certificate_to_pem(old_ca.ca_cert)
     
     ca = CA()
     assert not ca.load(key_pem, cert_pem)
     assert not ca.has_ca()