Document functions added as a result of DSA opacity changes
[openssl.git] / doc / crypto / DSA_get0_pqg.pod
1 =pod
2
3 =head1 NAME
4
5 DSA_get0_pqg, DSA_set0_pgg, DSA_get0_key, DSA_set0_key, DSA_clear_flags,
6 DSA_test_flags, DSA_set_flags, DSA_get0_engine - Routines for getting and
7 setting data in a DSA object
8
9 =head1 SYNOPSIS
10
11  #include <openssl/dsa.h>
12
13  void DSA_get0_pqg(const DSA *d, BIGNUM **p, BIGNUM **q, BIGNUM **g);
14  int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
15  void DSA_get0_key(const DSA *d, BIGNUM **pub_key, BIGNUM **priv_key);
16  int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
17  void DSA_clear_flags(DSA *d, int flags);
18  int DSA_test_flags(const DSA *d, int flags);
19  void DSA_set_flags(DSA *d, int flags);
20  ENGINE *DSA_get0_engine(DSA *d);
21
22 =head1 DESCRIPTION
23
24 A DSA object contains the parameters B<p>, B<q> and B<g>. It also contains a
25 public key (B<pub_key>) and (optionally) a private key (B<priv_key>).
26
27 The B<p>, B<q> and B<g> parameters can be obtained by calling DSA_get0_pqg().
28 If the parameters have not yet been set then B<*p>, B<*q> and B<*g> will be set
29 to NULL. Otherwise they are set to pointers to their respective values. These
30 point directly to the internal representations of the values and therefore
31 should not be freed directly.
32
33 The B<p>, B<q> and B<g> values can be set by calling DSA_set0_pqg() and passing
34 the new values for B<p>, B<q> and B<g> as parameters to the function. Calling
35 this function transfers the memory management of the values to the DSA object,
36 and therefore the values that have been passed in should not be freed directly
37 after this function has been called.
38
39 To get the public and private key values use the DSA_get0_key() function. A
40 pointer to the public key will be stored in B<*pub_key>, and a pointer to the
41 private key will be stored in B<*priv_key>. Either may be NULL if they have not
42 been set yet, although if the private key has been set then the public key must
43 be. The values point to the internal representation of the public key and
44 private key values. This memory should not be freed directly.
45
46 The public and private key values can be set using DSA_set0_key(). The public
47 key must always be non-NULL. The private key may be NULL. As for DSA_set0_pqg()
48 this function transfers the memory management of the key values to the DSA
49 object, and therefore they should not be freed directly after this function has
50 been called.
51
52 DSA_set_flags() sets the flags in the B<flags> parameter on the DSA object.
53 Multiple flags can be passed in one go (bitwise ORed together). Any flags that
54 are already set are left set. DSA_test_flags() tests to see whether the flags
55 passed in the B<flags> parameter are currently set in the DSA object. Multple
56 flags can be tested in one go. All flags that are currently set are returned, or
57 zero if none of the flags are set. DSA_clear_flags() clears the specified flags
58 within the DSA object.
59
60 DSA_get0_engine() returns a handle to the ENGINE that has been set for this DSA
61 object, or NULL if no such ENGINE has been set.
62
63 =head1 RETURN VALUES
64
65 DSA_set0_pqg() and DSA_set0_key() return 1 on success or 0 on failure.
66
67 DSA_test_flags() returns the current state of the flags in the DSA object.
68
69 DSA_get0_engine() returns the ENGINE set for the DSA object or NULL if no ENGINE
70 has been set.
71
72 =head1 SEE ALSO
73
74 L<dsa>, L<DSA_new>, L<DSA_generate_parameters>, L<DSA_generate_key>,
75 L<DSA_dup_DH>, L<DSA_do_sign>, L<DSA_set_method>, L<DSA_SIG_new>, L<DSA_sign>,
76 L<DSA_size>, L<DSA_meth_new>
77
78 =head1 HISTORY
79
80 The functions described here were added in OpenSSL version 1.1.0.
81
82 =cut