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