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