Checking if an EVP_PKEY* contains a private key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux