xref: /onnv-gate/usr/src/common/openssl/doc/crypto/d2i_DSAPublicKey.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey,
6*2175Sjp161948d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding
7*2175Sjp161948and parsing functions.
8*2175Sjp161948
9*2175Sjp161948=head1 SYNOPSIS
10*2175Sjp161948
11*2175Sjp161948 #include <openssl/dsa.h>
12*2175Sjp161948 #include <openssl/x509.h>
13*2175Sjp161948
14*2175Sjp161948 DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
15*2175Sjp161948
16*2175Sjp161948 int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
17*2175Sjp161948
18*2175Sjp161948 DSA * d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length);
19*2175Sjp161948
20*2175Sjp161948 int i2d_DSA_PUBKEY(const DSA *a, unsigned char **pp);
21*2175Sjp161948
22*2175Sjp161948 DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
23*2175Sjp161948
24*2175Sjp161948 int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
25*2175Sjp161948
26*2175Sjp161948 DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
27*2175Sjp161948
28*2175Sjp161948 int i2d_DSAparams(const DSA *a, unsigned char **pp);
29*2175Sjp161948
30*2175Sjp161948 DSA * d2i_DSA_SIG(DSA_SIG **a, const unsigned char **pp, long length);
31*2175Sjp161948
32*2175Sjp161948 int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
33*2175Sjp161948
34*2175Sjp161948=head1 DESCRIPTION
35*2175Sjp161948
36*2175Sjp161948d2i_DSAPublicKey() and i2d_DSAPublicKey() decode and encode the DSA public key
37*2175Sjp161948components structure.
38*2175Sjp161948
39*2175Sjp161948d2i_DSA_PUBKEY() and i2d_DSA_PUBKEY() decode and encode an DSA public key using
40*2175Sjp161948a SubjectPublicKeyInfo (certificate public key) structure.
41*2175Sjp161948
42*2175Sjp161948d2i_DSAPrivateKey(), i2d_DSAPrivateKey() decode and encode the DSA private key
43*2175Sjp161948components.
44*2175Sjp161948
45*2175Sjp161948d2i_DSAparams(), i2d_DSAparams() decode and encode the DSA parameters using
46*2175Sjp161948a B<Dss-Parms> structure as defined in RFC2459.
47*2175Sjp161948
48*2175Sjp161948d2i_DSA_SIG(), i2d_DSA_SIG() decode and encode a DSA signature using a
49*2175Sjp161948B<Dss-Sig-Value> structure as defined in RFC2459.
50*2175Sjp161948
51*2175Sjp161948The usage of all of these functions is similar to the d2i_X509() and
52*2175Sjp161948i2d_X509() described in the L<d2i_X509(3)|d2i_X509(3)> manual page.
53*2175Sjp161948
54*2175Sjp161948=head1 NOTES
55*2175Sjp161948
56*2175Sjp161948The B<DSA> structure passed to the private key encoding functions should have
57*2175Sjp161948all the private key components present.
58*2175Sjp161948
59*2175Sjp161948The data encoded by the private key functions is unencrypted and therefore
60*2175Sjp161948offers no private key security.
61*2175Sjp161948
62*2175Sjp161948The B<DSA_PUBKEY> functions should be used in preference to the B<DSAPublicKey>
63*2175Sjp161948functions when encoding public keys because they use a standard format.
64*2175Sjp161948
65*2175Sjp161948The B<DSAPublicKey> functions use an non standard format the actual data encoded
66*2175Sjp161948depends on the value of the B<write_params> field of the B<a> key parameter.
67*2175Sjp161948If B<write_params> is zero then only the B<pub_key> field is encoded as an
68*2175Sjp161948B<INTEGER>. If B<write_params> is 1 then a B<SEQUENCE> consisting of the
69*2175Sjp161948B<p>, B<q>, B<g> and B<pub_key> respectively fields are encoded.
70*2175Sjp161948
71*2175Sjp161948The B<DSAPrivateKey> functions also use a non standard structure consiting
72*2175Sjp161948consisting of a SEQUENCE containing the B<p>, B<q>, B<g> and B<pub_key> and
73*2175Sjp161948B<priv_key> fields respectively.
74*2175Sjp161948
75*2175Sjp161948=head1 SEE ALSO
76*2175Sjp161948
77*2175Sjp161948L<d2i_X509(3)|d2i_X509(3)>
78*2175Sjp161948
79*2175Sjp161948=head1 HISTORY
80*2175Sjp161948
81*2175Sjp161948TBA
82*2175Sjp161948
83*2175Sjp161948=cut
84