]> WPIA git - cassiopeia.git/blobdiff - src/crypto/simpleOpensslSigner.cpp
fix: be able to load CAs without private key
[cassiopeia.git] / src / crypto / simpleOpensslSigner.cpp
index cad772c4e102b9007c33e80cc921ee0af77c86d2..6987d2c4e84085c25c3349f5c334e42e82475dbe 100644 (file)
@@ -86,6 +86,9 @@ std::shared_ptr<SignedCertificate> SimpleOpensslSigner::sign( std::shared_ptr<TB
         logger::error( "ERROR: Signing CA specified in profile could not be loaded." );
         throw std::runtime_error("CA-key not found");
     }
+    if(!ca->caKey){
+        throw std::runtime_error("Cannot sign certificate with CA " + ca->name + " because it has no private key.");
+    }
 
     logger::note( "FINE: Key for Signing CA is correctly loaded." );