rsa_get0_all_params.pod 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. =pod
  2. =head1 NAME
  3. rsa_set0_all_params, rsa_get0_all_params
  4. - Internal routines for getting and setting data in an RSA object
  5. =head1 SYNOPSIS
  6. #include "crypto/rsa.h"
  7. int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
  8. STACK_OF(BIGNUM_const) *exps,
  9. STACK_OF(BIGNUM_const) *coeffs);
  10. int rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
  11. const STACK_OF(BIGNUM) *exps,
  12. const STACK_OF(BIGNUM) *coeffs);
  13. =head1 DESCRIPTION
  14. rsa_set0_all_params() sets all primes, CRT exponents and CRT coefficients
  15. in the B<RSA> object I<r> to the contents of the stacks of BIGNUMs I<primes>,
  16. I<exps> and I<coeffs>. The B<RSA> object takes ownership of the BIGNUMs,
  17. but not of the stacks.
  18. rsa_get0_all_params() gets all primes, CRT exponents and CRT coefficients
  19. in the B<RSA> object I<r> and pushes them on the stacks of constant BIGNUMs
  20. I<primes>, I<exps> and I<coeffs>. The B<RSA> object retains ownership of the
  21. BIGNUMs, but not of the stacks.
  22. =head1 NOTES
  23. For RSA_set0_all_params() and RSA_get0_all_params():
  24. =over 4
  25. =item *
  26. the I<primes> stack contains I<p>, I<q>, and then the rest of the primes
  27. if the B<RSA> object is a multi-prime RSA key.
  28. =item *
  29. the I<exps> stack contains I<dP>, I<dQ>, and then the rest of the exponents
  30. if the B<RSA> object is a multi-prime RSA key.
  31. =item *
  32. the I<coeffs> stack contains I<qInv>, and then the rest of the coefficients
  33. if the B<RSA> object is a multi-prime RSA key.
  34. =back
  35. The number of primes must always be equal to the number of exponents, and
  36. the number of coefficients must be one less than the number of primes.
  37. =head1 RETURN VALUES
  38. rsa_get0_all_params() and rsa_set0_all_params() return 1 on success, or
  39. 0 on failure.
  40. =head1 SEE ALSO
  41. L<RSA_set0_multi_prime_params(3)>
  42. =head1 COPYRIGHT
  43. Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
  44. Licensed under the Apache License 2.0 (the "License"). You may not use
  45. this file except in compliance with the License. You can obtain a copy
  46. in the file LICENSE in the source distribution or at
  47. L<https://www.openssl.org/source/license.html>.
  48. =cut