views:

39

answers:

1

In the PKey class documentation of the M2Crypto python package (an OpenSSL wrapper for Python) it is said that PKey is a reference to a Public key.

My opinion is instead that it's a reference to a Private Key because the init method of the PKey class calls the evp_pkey_new openssl function that, from this link: http://linux.die.net/man/3/evp_pkey_new , should allocate a new reference to a private key structure!

There are two only possible explaination: The M2Crypto documentation is wrong or the link I've reported has wrong informations.

Can someone help me to find the truth?

+1  A: 

The OpenSSL documentation is incomplete - the EVP_PKEY structure allocated by EVP_PKEY_new() is used to store either private or public keys. The type of key is determined by what you later load into the structure.

(Eg. both EVP_SealInit() and EVP_OpenInit take EVP_PKEY parameters).

caf