New option to CA.pl to sign request using CA extensions.
[openssl.git] / crypto / pkcs12 / p12_crt.c
index a5f17c5..5641a00 100644 (file)
@@ -86,6 +86,8 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
                return NULL;
        }
 
+       if(!X509_check_private_key(cert, pkey)) return NULL;
+
        if(!(bags = sk_PKCS12_SAFEBAG_new (NULL))) {
                PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
                return NULL;