| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "DSA_GET0_PQG 3SSL" |
| 58 |
.TH DSA_GET0_PQG 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
DSA_get0_pqg, DSA_set0_pqg, DSA_get0_key, DSA_set0_key, |
| 65 |
DSA_get0_p, DSA_get0_q, DSA_get0_g, |
| 66 |
DSA_get0_pub_key, DSA_get0_priv_key, |
| 67 |
DSA_clear_flags, DSA_test_flags, DSA_set_flags, |
| 68 |
DSA_get0_engine \- Routines for getting and |
| 69 |
setting data in a DSA object |
| 70 |
.SH SYNOPSIS |
| 71 |
.IX Header "SYNOPSIS" |
| 72 |
.Vb 1 |
| 73 |
\& #include <openssl/dsa.h> |
| 74 |
.Ve |
| 75 |
.PP |
| 76 |
The following functions have been deprecated since OpenSSL 3.0, and can be |
| 77 |
hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value, |
| 78 |
see \fBopenssl_user_macros\fR\|(7): |
| 79 |
.PP |
| 80 |
.Vb 10 |
| 81 |
\& void DSA_get0_pqg(const DSA *d, |
| 82 |
\& const BIGNUM **p, const BIGNUM **q, const BIGNUM **g); |
| 83 |
\& int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); |
| 84 |
\& void DSA_get0_key(const DSA *d, |
| 85 |
\& const BIGNUM **pub_key, const BIGNUM **priv_key); |
| 86 |
\& int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); |
| 87 |
\& const BIGNUM *DSA_get0_p(const DSA *d); |
| 88 |
\& const BIGNUM *DSA_get0_q(const DSA *d); |
| 89 |
\& const BIGNUM *DSA_get0_g(const DSA *d); |
| 90 |
\& const BIGNUM *DSA_get0_pub_key(const DSA *d); |
| 91 |
\& const BIGNUM *DSA_get0_priv_key(const DSA *d); |
| 92 |
\& void DSA_clear_flags(DSA *d, int flags); |
| 93 |
\& int DSA_test_flags(const DSA *d, int flags); |
| 94 |
\& void DSA_set_flags(DSA *d, int flags); |
| 95 |
\& ENGINE *DSA_get0_engine(DSA *d); |
| 96 |
.Ve |
| 97 |
.SH DESCRIPTION |
| 98 |
.IX Header "DESCRIPTION" |
| 99 |
All of the functions described on this page are deprecated. |
| 100 |
Applications should instead use \fBEVP_PKEY_get_bn_param\fR\|(3). |
| 101 |
.PP |
| 102 |
A DSA object contains the parameters \fBp\fR, \fBq\fR and \fBg\fR. It also contains a |
| 103 |
public key (\fBpub_key\fR) and (optionally) a private key (\fBpriv_key\fR). |
| 104 |
.PP |
| 105 |
The \fBp\fR, \fBq\fR and \fBg\fR parameters can be obtained by calling \fBDSA_get0_pqg()\fR. |
| 106 |
If the parameters have not yet been set then \fB*p\fR, \fB*q\fR and \fB*g\fR will be set |
| 107 |
to NULL. Otherwise they are set to pointers to their respective values. These |
| 108 |
point directly to the internal representations of the values and therefore |
| 109 |
should not be freed directly. |
| 110 |
.PP |
| 111 |
The \fBp\fR, \fBq\fR and \fBg\fR values can be set by calling \fBDSA_set0_pqg()\fR and passing |
| 112 |
the new values for \fBp\fR, \fBq\fR and \fBg\fR as parameters to the function. Calling |
| 113 |
this function transfers the memory management of the values to the DSA object, |
| 114 |
and therefore the values that have been passed in should not be freed directly |
| 115 |
after this function has been called. |
| 116 |
.PP |
| 117 |
To get the public and private key values use the \fBDSA_get0_key()\fR function. A |
| 118 |
pointer to the public key will be stored in \fB*pub_key\fR, and a pointer to the |
| 119 |
private key will be stored in \fB*priv_key\fR. Either may be NULL if they have not |
| 120 |
been set yet, although if the private key has been set then the public key must |
| 121 |
be. The values point to the internal representation of the public key and |
| 122 |
private key values. This memory should not be freed directly. |
| 123 |
.PP |
| 124 |
The public and private key values can be set using \fBDSA_set0_key()\fR. The public |
| 125 |
key must be non-NULL the first time this function is called on a given DSA |
| 126 |
object. The private key may be NULL. On subsequent calls, either may be NULL, |
| 127 |
which means the corresponding DSA field is left untouched. As for \fBDSA_set0_pqg()\fR |
| 128 |
this function transfers the memory management of the key values to the DSA |
| 129 |
object, and therefore they should not be freed directly after this function has |
| 130 |
been called. |
| 131 |
.PP |
| 132 |
Any of the values \fBp\fR, \fBq\fR, \fBg\fR, \fBpriv_key\fR, and \fBpub_key\fR can also be |
| 133 |
retrieved separately by the corresponding function \fBDSA_get0_p()\fR, \fBDSA_get0_q()\fR, |
| 134 |
\&\fBDSA_get0_g()\fR, \fBDSA_get0_priv_key()\fR, and \fBDSA_get0_pub_key()\fR, respectively. |
| 135 |
.PP |
| 136 |
\&\fBDSA_set_flags()\fR sets the flags in the \fBflags\fR parameter on the DSA object. |
| 137 |
Multiple flags can be passed in one go (bitwise ORed together). Any flags that |
| 138 |
are already set are left set. \fBDSA_test_flags()\fR tests to see whether the flags |
| 139 |
passed in the \fBflags\fR parameter are currently set in the DSA object. Multiple |
| 140 |
flags can be tested in one go. All flags that are currently set are returned, or |
| 141 |
zero if none of the flags are set. \fBDSA_clear_flags()\fR clears the specified flags |
| 142 |
within the DSA object. |
| 143 |
.PP |
| 144 |
\&\fBDSA_get0_engine()\fR returns a handle to the ENGINE that has been set for this DSA |
| 145 |
object, or NULL if no such ENGINE has been set. |
| 146 |
.SH NOTES |
| 147 |
.IX Header "NOTES" |
| 148 |
Values retrieved with \fBDSA_get0_key()\fR are owned by the DSA object used |
| 149 |
in the call and may therefore \fInot\fR be passed to \fBDSA_set0_key()\fR. If |
| 150 |
needed, duplicate the received value using \fBBN_dup()\fR and pass the |
| 151 |
duplicate. The same applies to \fBDSA_get0_pqg()\fR and \fBDSA_set0_pqg()\fR. |
| 152 |
.SH "RETURN VALUES" |
| 153 |
.IX Header "RETURN VALUES" |
| 154 |
\&\fBDSA_set0_pqg()\fR and \fBDSA_set0_key()\fR return 1 on success or 0 on failure. |
| 155 |
.PP |
| 156 |
\&\fBDSA_test_flags()\fR returns the current state of the flags in the DSA object. |
| 157 |
.PP |
| 158 |
\&\fBDSA_get0_engine()\fR returns the ENGINE set for the DSA object or NULL if no ENGINE |
| 159 |
has been set. |
| 160 |
.SH "SEE ALSO" |
| 161 |
.IX Header "SEE ALSO" |
| 162 |
\&\fBEVP_PKEY_get_bn_param\fR\|(3), |
| 163 |
\&\fBDSA_new\fR\|(3), \fBDSA_new\fR\|(3), \fBDSA_generate_parameters\fR\|(3), \fBDSA_generate_key\fR\|(3), |
| 164 |
\&\fBDSA_dup_DH\fR\|(3), \fBDSA_do_sign\fR\|(3), \fBDSA_set_method\fR\|(3), \fBDSA_SIG_new\fR\|(3), |
| 165 |
\&\fBDSA_sign\fR\|(3), \fBDSA_size\fR\|(3), \fBDSA_meth_new\fR\|(3) |
| 166 |
.SH HISTORY |
| 167 |
.IX Header "HISTORY" |
| 168 |
The functions described here were added in OpenSSL 1.1.0 and deprecated in |
| 169 |
OpenSSL 3.0. |
| 170 |
.SH COPYRIGHT |
| 171 |
.IX Header "COPYRIGHT" |
| 172 |
Copyright 2016\-2018 The OpenSSL Project Authors. All Rights Reserved. |
| 173 |
.PP |
| 174 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 175 |
this file except in compliance with the License. You can obtain a copy |
| 176 |
in the file LICENSE in the source distribution or at |
| 177 |
<https://www.openssl.org/source/license.html>. |