
#use wml::openssl-macros area=docs page=d2i_DSAPublicKey

<title>Documents, d2i_DSAPublicKey(3)</title>

<h1>d2i_DSAPublicKey(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
d2i_DSAPublicKey, i2d_DSAPublicKey, d2i_DSAPrivateKey, i2d_DSAPrivateKey,
d2i_DSA_PUBKEY, i2d_DSA_PUBKEY, d2i_DSA_SIG, i2d_DSA_SIG - DSA key encoding
and parsing functions.

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/dsa.h&gt;
 \#include &lt;openssl/x509.h&gt;
</PRE>
<PRE> DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
</PRE>
<PRE> DSA * d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_DSA_PUBKEY(const DSA *a, unsigned char **pp);
</PRE>
<PRE> DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
</PRE>
<PRE> DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_DSAparams(const DSA *a, unsigned char **pp);
</PRE>
<PRE> DSA * d2i_DSA_SIG(DSA_SIG **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>d2i_DSAPublicKey()</CODE> and <CODE>i2d_DSAPublicKey()</CODE> decode
and encode the DSA public key components structure.

</P>
<P>
<CODE>d2i_DSA_PUBKEY()</CODE> and <CODE>i2d_DSA_PUBKEY()</CODE> decode and
encode an DSA public key using a SubjectPublicKeyInfo (certificate public
key) structure.

</P>
<P>
<CODE>d2i_DSAPrivateKey(),</CODE> <CODE>i2d_DSAPrivateKey()</CODE> decode
and encode the DSA private key components.

</P>
<P>
<CODE>d2i_DSAparams(),</CODE> <CODE>i2d_DSAparams()</CODE> decode and
encode the DSA parameters using a <STRONG>Dss-Parms</STRONG> structure as defined in RFC2459.

</P>
<P>
<CODE>d2i_DSA_SIG(),</CODE> <CODE>i2d_DSA_SIG()</CODE> decode and encode a
DSA signature using a
<STRONG>Dss-Sig-Value</STRONG> structure as defined in RFC2459.

</P>
<P>
The usage of all of these functions is similar to the
<CODE>d2i_X509()</CODE> and <CODE>i2d_X509()</CODE> described in the <A HREF="../crypto/d2i_X509.html#">d2i_X509(3)</A> manual page.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The <STRONG>DSA</STRONG> structure passed to the private key encoding functions should have all the
private key components present.

</P>
<P>
The data encoded by the private key functions is unencrypted and therefore
offers no private key security.

</P>
<P>
The <STRONG>DSA_PUBKEY</STRONG> functions should be used in preference to the <STRONG>DSAPublicKey</STRONG>
functions when encoding public keys because they use a standard format.

</P>
<P>
The <STRONG>DSAPublicKey</STRONG> functions use an non standard format the actual data encoded depends on the
value of the <STRONG>write_params</STRONG> field of the <STRONG>a</STRONG> key parameter. If <STRONG>write_params</STRONG> is zero then only the <STRONG>pub_key</STRONG> field is encoded as an
<STRONG>INTEGER</STRONG>. If <STRONG>write_params</STRONG> is 1 then a <STRONG>SEQUENCE</STRONG> consisting of the
<STRONG>p</STRONG>, <STRONG>q</STRONG>, <STRONG>g</STRONG> and <STRONG>pub_key</STRONG> respectively fields are encoded.

</P>
<P>
The <STRONG>DSAPrivateKey</STRONG> functions also use a non standard structure consiting consisting of a
SEQUENCE containing the <STRONG>p</STRONG>, <STRONG>q</STRONG>, <STRONG>g</STRONG> and <STRONG>pub_key</STRONG> and
<STRONG>priv_key</STRONG> fields respectively.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/d2i_X509.html#">d2i_X509(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
TBA

</P>
:}


