<div>š</div><div>I have found some info and now some questions more clear for me. But still have 2 questions...</div><div>š</div><div>i2d_ functions write the DER representation of the object into a buffer.</div><div>d2i_ functions read the DER representation of the object from a buffer and creates the appropriate object in memory.</div><div>š</div><div><strong>1. What is b2i_ and i2b_ functions?</strong></div><div>š</div><div>š</div><div>EVP_PKEY structure can hold public or private key. It's strangely why there is no this info in the official documentation on www.openssl.org</div><div>š</div><div><strong>2. Can EVP_PKEY structure hold both private and public keys at once?</strong></div><div>š</div><div>I have some example of code and there is a use of EVP_PKEY in this manner, that's why I am asking.</div><div>š</div><div>š</div><div>03.02.2015, 13:21, "Serj" <rasjv@yandex.com>:</div><div>> Hello.</div><div>></div><div>> I see many functions have prefixes: i2d_ d2i_ b2i_ i2b_</div><div>></div><div>> For example:</div><div>> i2d_PublicKey</div><div>> i2d_PrivateKey</div><div>></div><div>> d2i_PublicKey</div><div>> d2i_PrivateKey</div><div>></div><div>> b2i_PublicKey</div><div>> b2i_PrivateKey</div><div>></div><div>> i2b_PublicKey_bio</div><div>> i2b_PrivateKey_bio</div><div>></div><div>> I think these letters: 'i', 'd', 'b' have some meaning. Can somebody help me to understand what they are mean?</div><div>></div><div>> And one more question.</div><div>> In accordance to: https://www.openssl.org/docs/crypto/EVP_PKEY_new.html, EVP_PKEY structure is used by OpenSSL to store private keys. But there are above functions which use as parameters pointer to EVP_PKEY structure and as they are named they can work with both public and private keys. So the questions are:</div><div>> 1. can we save to EVP_PKEY structure public key not private?</div><div>> 2. can we save to EVP_PKEY structure public and private keys at once?</div><div>></div><div>> For example:</div><div>> EVP_PKEY * pkey;</div><div>> pkey = EVP_PKEY_new();</div><div>> RSA * rsa;</div><div>> rsa = RSA_generate_key(...)</div><div>> EVP_PKEY_assign_RSA(pkey, rsa);</div><div>></div><div>> What key or keys will be in pkey after that?</div><div>š</div><div>š</div><div>--</div><div>Best Regards,</div><div>š</div><div>Serj</div>