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