>There isn't much difference between this:
>
>    RSA_set0_key(rsa, n, NULL, NULL);
>    RSA_set0_key(rsa, NULL, e, NULL);
>    RSA_set0_key(rsa, NULL, NULL, d);
>
>and something like this:
>
>    RSA_set0_n(rsa, n);
>    RSA_set0_e(rsa, e);
>    RSA_set0_d(rsa, d);

The attractiveness of RSA_set0_key(rsa, n, NULL, NULL); is that you can
provide whatever many (from 1 to 3 :) parameters using the same single
function call, rather than learning three different (albeit quite simple
:) independent functions.

>The only difference is that with the former, you get two-in-one, as it
>also works as a function to set all three numbers in one go.

Yes, but this difference adds convenience, IMHO. My preference is this:
RSA_set0_key(rsa, n, e, d); with any parameter (except for rsa :)
potentially NULL.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to