I have found some info and now some questions more clear for me. But still have 2 questions...
i2d_ functions write the DER representation of the object into a buffer.
d2i_ functions read the DER representation of the object from a buffer and creates the appropriate object in memory.
1. What is b2i_ and i2b_ functions?
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
2. Can EVP_PKEY structure hold both private and public keys at once?
I have some example of code and there is a use of EVP_PKEY in this manner, that's why I am asking.
03.02.2015, 13:21, "Serj" <ra...@yandex.com>:
> Hello.
>
> I see many functions have prefixes: i2d_ d2i_ b2i_ i2b_
>
> For example:
> i2d_PublicKey
> i2d_PrivateKey
>
> d2i_PublicKey
> d2i_PrivateKey
>
> b2i_PublicKey
> b2i_PrivateKey
>
> i2b_PublicKey_bio
> i2b_PrivateKey_bio
>
> I think these letters: 'i', 'd', 'b' have some meaning. Can somebody help me to understand what they are mean?
>
> And one more question.
> 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:
> 1. can we save to EVP_PKEY structure public key not private?
> 2. can we save to EVP_PKEY structure public and private keys at once?
>
> For example:
> EVP_PKEY * pkey;
> pkey = EVP_PKEY_new();
> RSA * rsa;
> rsa = RSA_generate_key(...)
> EVP_PKEY_assign_RSA(pkey, rsa);
>
> What key or keys will be in pkey after that?
--
Best Regards,
Serj
_______________________________________________ openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users