Beispiel #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()
Beispiel #2
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()
Beispiel #3
0
    def testItShouldHaveACAAfterCreation(self):
        ca = CA()
        ca.create_ca()

        assert ca.has_ca()
Beispiel #4
0
    def testItShouldNotHaveACAByDefault(self):
        ca = CA()

        assert not ca.has_ca()