1DSA_GET0_PQG(3)                     OpenSSL                    DSA_GET0_PQG(3)
2
3
4

NAME

6       DSA_get0_pqg, DSA_set0_pqg, DSA_get0_key, DSA_set0_key, DSA_get0_p,
7       DSA_get0_q, DSA_get0_g, DSA_get0_pub_key, DSA_get0_priv_key,
8       DSA_clear_flags, DSA_test_flags, DSA_set_flags, DSA_get0_engine -
9       Routines for getting and setting data in a DSA object
10

SYNOPSIS

12        #include <openssl/dsa.h>
13
14        void DSA_get0_pqg(const DSA *d,
15                          const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
16        int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
17        void DSA_get0_key(const DSA *d,
18                          const BIGNUM **pub_key, const BIGNUM **priv_key);
19        int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
20        const BIGNUM *DSA_get0_p(const DSA *d);
21        const BIGNUM *DSA_get0_q(const DSA *d);
22        const BIGNUM *DSA_get0_g(const DSA *d);
23        const BIGNUM *DSA_get0_pub_key(const DSA *d);
24        const BIGNUM *DSA_get0_priv_key(const DSA *d);
25        void DSA_clear_flags(DSA *d, int flags);
26        int DSA_test_flags(const DSA *d, int flags);
27        void DSA_set_flags(DSA *d, int flags);
28        ENGINE *DSA_get0_engine(DSA *d);
29

DESCRIPTION

31       A DSA object contains the parameters p, q and g. It also contains a
32       public key (pub_key) and (optionally) a private key (priv_key).
33
34       The p, q and g parameters can be obtained by calling DSA_get0_pqg().
35       If the parameters have not yet been set then *p, *q and *g will be set
36       to NULL. Otherwise they are set to pointers to their respective values.
37       These point directly to the internal representations of the values and
38       therefore should not be freed directly.
39
40       The p, q and g values can be set by calling DSA_set0_pqg() and passing
41       the new values for p, q and g as parameters to the function. Calling
42       this function transfers the memory management of the values to the DSA
43       object, and therefore the values that have been passed in should not be
44       freed directly after this function has been called.
45
46       To get the public and private key values use the DSA_get0_key()
47       function. A pointer to the public key will be stored in *pub_key, and a
48       pointer to the private key will be stored in *priv_key. Either may be
49       NULL if they have not been set yet, although if the private key has
50       been set then the public key must be. The values point to the internal
51       representation of the public key and private key values. This memory
52       should not be freed directly.
53
54       The public and private key values can be set using DSA_set0_key(). The
55       public key must be non-NULL the first time this function is called on a
56       given DSA object. The private key may be NULL.  On subsequent calls,
57       either may be NULL, which means the corresponding DSA field is left
58       untouched. As for DSA_set0_pqg() this function transfers the memory
59       management of the key values to the DSA object, and therefore they
60       should not be freed directly after this function has been called.
61
62       Any of the values p, q, g, priv_key, and pub_key can also be retrieved
63       separately by the corresponding function DSA_get0_p(), DSA_get0_q(),
64       DSA_get0_g(), DSA_get0_priv_key(), and DSA_get0_pub_key(),
65       respectively.
66
67       DSA_set_flags() sets the flags in the flags parameter on the DSA
68       object.  Multiple flags can be passed in one go (bitwise ORed
69       together). Any flags that are already set are left set.
70       DSA_test_flags() tests to see whether the flags passed in the flags
71       parameter are currently set in the DSA object. Multiple flags can be
72       tested in one go. All flags that are currently set are returned, or
73       zero if none of the flags are set. DSA_clear_flags() clears the
74       specified flags within the DSA object.
75
76       DSA_get0_engine() returns a handle to the ENGINE that has been set for
77       this DSA object, or NULL if no such ENGINE has been set.
78

NOTES

80       Values retrieved with DSA_get0_key() are owned by the DSA object used
81       in the call and may therefore not be passed to DSA_set0_key().  If
82       needed, duplicate the received value using BN_dup() and pass the
83       duplicate.  The same applies to DSA_get0_pqg() and DSA_set0_pqg().
84

RETURN VALUES

86       DSA_set0_pqg() and DSA_set0_key() return 1 on success or 0 on failure.
87
88       DSA_test_flags() returns the current state of the flags in the DSA
89       object.
90
91       DSA_get0_engine() returns the ENGINE set for the DSA object or NULL if
92       no ENGINE has been set.
93

SEE ALSO

95       DSA_new(3), DSA_new(3), DSA_generate_parameters(3),
96       DSA_generate_key(3), DSA_dup_DH(3), DSA_do_sign(3), DSA_set_method(3),
97       DSA_SIG_new(3), DSA_sign(3), DSA_size(3), DSA_meth_new(3)
98

HISTORY

100       The functions described here were added in OpenSSL 1.1.0.
101
103       Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
104
105       Licensed under the OpenSSL license (the "License").  You may not use
106       this file except in compliance with the License.  You can obtain a copy
107       in the file LICENSE in the source distribution or at
108       <https://www.openssl.org/source/license.html>.
109
110
111
1121.1.1c                            2019-05-28                   DSA_GET0_PQG(3)
Impressum