xref: /onnv-gate/usr/src/common/openssl/doc/crypto/d2i_RSAPublicKey.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948d2i_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey,
6*2175Sjp161948d2i_RSA_PUBKEY, i2d_RSA_PUBKEY, i2d_Netscape_RSA,
7*2175Sjp161948d2i_Netscape_RSA - RSA public and private key encoding functions.
8*2175Sjp161948
9*2175Sjp161948=head1 SYNOPSIS
10*2175Sjp161948
11*2175Sjp161948 #include <openssl/rsa.h>
12*2175Sjp161948 #include <openssl/x509.h>
13*2175Sjp161948
14*2175Sjp161948 RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length);
15*2175Sjp161948
16*2175Sjp161948 int i2d_RSAPublicKey(RSA *a, unsigned char **pp);
17*2175Sjp161948
18*2175Sjp161948 RSA * d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length);
19*2175Sjp161948
20*2175Sjp161948 int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
21*2175Sjp161948
22*2175Sjp161948 RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
23*2175Sjp161948
24*2175Sjp161948 int i2d_RSAPrivateKey(RSA *a, unsigned char **pp);
25*2175Sjp161948
26*2175Sjp161948 int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)());
27*2175Sjp161948
28*2175Sjp161948 RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)());
29*2175Sjp161948
30*2175Sjp161948=head1 DESCRIPTION
31*2175Sjp161948
32*2175Sjp161948d2i_RSAPublicKey() and i2d_RSAPublicKey() decode and encode a PKCS#1 RSAPublicKey
33*2175Sjp161948structure.
34*2175Sjp161948
35*2175Sjp161948d2i_RSA_PUBKEY() and i2d_RSA_PUBKEY() decode and encode an RSA public key using
36*2175Sjp161948a SubjectPublicKeyInfo (certificate public key) structure.
37*2175Sjp161948
38*2175Sjp161948d2i_RSAPrivateKey(), i2d_RSAPrivateKey() decode and encode a PKCS#1 RSAPrivateKey
39*2175Sjp161948structure.
40*2175Sjp161948
41*2175Sjp161948d2i_Netscape_RSA(), i2d_Netscape_RSA() decode and encode an RSA private key in
42*2175Sjp161948NET format.
43*2175Sjp161948
44*2175Sjp161948The usage of all of these functions is similar to the d2i_X509() and
45*2175Sjp161948i2d_X509() described in the L<d2i_X509(3)|d2i_X509(3)> manual page.
46*2175Sjp161948
47*2175Sjp161948=head1 NOTES
48*2175Sjp161948
49*2175Sjp161948The B<RSA> structure passed to the private key encoding functions should have
50*2175Sjp161948all the PKCS#1 private key components present.
51*2175Sjp161948
52*2175Sjp161948The data encoded by the private key functions is unencrypted and therefore
53*2175Sjp161948offers no private key security.
54*2175Sjp161948
55*2175Sjp161948The NET format functions are present to provide compatibility with certain very
56*2175Sjp161948old software. This format has some severe security weaknesses and should be
57*2175Sjp161948avoided if possible.
58*2175Sjp161948
59*2175Sjp161948=head1 SEE ALSO
60*2175Sjp161948
61*2175Sjp161948L<d2i_X509(3)|d2i_X509(3)>
62*2175Sjp161948
63*2175Sjp161948=head1 HISTORY
64*2175Sjp161948
65*2175Sjp161948TBA
66*2175Sjp161948
67*2175Sjp161948=cut
68