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

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

<h1>d2i_RSAPublicKey(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_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey,
d2i_RSA_PUBKEY, i2d_RSA_PUBKEY, i2d_Netscape_RSA, d2i_Netscape_RSA - RSA
public and private key encoding functions.

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/rsa.h&gt;
 \#include &lt;openssl/x509.h&gt;
</PRE>
<PRE> RSA * d2i_RSAPublicKey(RSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_RSAPublicKey(RSA *a, unsigned char **pp);
</PRE>
<PRE> RSA * d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
</PRE>
<PRE> RSA * d2i_RSAPrivateKey(RSA **a, const unsigned char **pp, long length);
</PRE>
<PRE> int i2d_RSAPrivateKey(RSA *a, unsigned char **pp);
</PRE>
<PRE> int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)());
</PRE>
<PRE> RSA * d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)());
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>d2i_RSAPublicKey()</CODE> and <CODE>i2d_RSAPublicKey()</CODE> decode
and encode a PKCS#1 RSAPublicKey structure.

</P>
<P>
<CODE>d2i_RSA_PUBKEY()</CODE> and <CODE>i2d_RSA_PUBKEY()</CODE> decode and
encode an RSA public key using a SubjectPublicKeyInfo (certificate public
key) structure.

</P>
<P>
<CODE>d2i_RSAPrivateKey(),</CODE> <CODE>i2d_RSAPrivateKey()</CODE> decode
and encode a PKCS#1 RSAPrivateKey structure.

</P>
<P>
<CODE>d2i_Netscape_RSA(),</CODE> <CODE>i2d_Netscape_RSA()</CODE> decode and
encode an RSA private key in NET format.

</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>RSA</STRONG> structure passed to the private key encoding functions should have all the
PKCS#1 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 NET format functions are present to provide compatibility with certain
very old software. This format has some severe security weaknesses and
should be avoided if possible.

</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>
:}


