On Mon, Dec 21, 2015 at 09:29:03PM -0800, Stephen Kou wrote:

> OpenSSL has the higher-level EVP_PKEY_* functions which work abstracts
> the public key cryptography algorithms.  However, sometimes a EVP_PKEY*
> only has a public key.  How could I check if a given EVP_PKEY* contains
> a private key?

    len = i2d_PrivateKey(key, NULL);
    if (len <= 0) {
        /* No private key, or error determining its DER length */
    } else {
        /* Private key available */
    }

-- 
        Viktor.
_______________________________________________
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

Reply via email to