1.Dd $Mdocdate: November 4 2016 $
2.Dt D2I_RSAPUBLICKEY 3
3.Os
4.Sh NAME
5.Nm d2i_RSAPublicKey ,
6.Nm i2d_RSAPublicKey ,
7.Nm d2i_RSAPrivateKey ,
8.Nm i2d_RSAPrivateKey ,
9.Nm d2i_RSA_PUBKEY ,
10.Nm i2d_RSA_PUBKEY ,
11.Nm i2d_Netscape_RSA ,
12.Nm d2i_Netscape_RSA
13.Nd RSA public and private key encoding functions
14.Sh SYNOPSIS
15.In openssl/rsa.h
16.In openssl/x509.h
17.Ft RSA *
18.Fo d2i_RSAPublicKey
19.Fa "RSA **a"
20.Fa "const unsigned char **pp"
21.Fa "long length"
22.Fc
23.Ft int
24.Fo i2d_RSAPublicKey
25.Fa "RSA *a"
26.Fa "unsigned char **pp"
27.Fc
28.Ft RSA *
29.Fo d2i_RSA_PUBKEY
30.Fa "RSA **a"
31.Fa "const unsigned char **pp"
32.Fa "long length"
33.Fc
34.Ft int
35.Fo i2d_RSA_PUBKEY
36.Fa "RSA *a"
37.Fa "unsigned char **pp"
38.Fc
39.Ft RSA *
40.Fo d2i_RSAPrivateKey
41.Fa "RSA **a"
42.Fa "const unsigned char **pp"
43.Fa "long length"
44.Fc
45.Ft int
46.Fo i2d_RSAPrivateKey
47.Fa "RSA *a"
48.Fa "unsigned char **pp"
49.Fc
50.Ft int
51.Fo i2d_Netscape_RSA
52.Fa "RSA *a"
53.Fa "unsigned char **pp"
54.Fa "int (*cb)()"
55.Fc
56.Ft RSA *
57.Fo d2i_Netscape_RSA
58.Fa "RSA **a"
59.Fa "const unsigned char **pp"
60.Fa "long length"
61.Fa "int (*cb)()"
62.Fc
63.Sh DESCRIPTION
64.Fn d2i_RSAPublicKey
65and
66.Fn i2d_RSAPublicKey
67decode and encode a PKCS#1 RSAPublicKey structure.
68.Pp
69.Fn d2i_RSA_PUBKEY
70and
71.Fn i2d_RSA_PUBKEY
72decode and encode an RSA public key using a SubjectPublicKeyInfo
73(certificate public key) structure.
74.Pp
75.Fn d2i_RSAPrivateKey ,
76.Fn i2d_RSAPrivateKey
77decode and encode a PKCS#1 RSAPrivateKey structure.
78.Pp
79.Fn d2i_Netscape_RSA ,
80.Fn i2d_Netscape_RSA
81decode and encode an RSA private key in NET format.
82.Pp
83The usage of all of these functions is similar to
84.Xr d2i_X509 3
85and
86.Xr i2d_X509 3 .
87.Pp
88The
89.Vt RSA
90structure passed to the private key encoding functions should have all
91the PKCS#1 private key components present.
92.Pp
93The data encoded by the private key functions is unencrypted and
94therefore offers no private key security.
95.Pp
96The NET format functions are present to provide compatibility with
97certain very old software.
98This format has some severe security weaknesses and should be avoided if
99possible.
100.Sh SEE ALSO
101.Xr d2i_X509 3
102