Debian Codegraph @

upstream/debian-unstable/man1/openssl-rsa.1ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "OPENSSL-RSA 1SSL"
58 .TH OPENSSL-RSA 1SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 openssl\-rsa \- RSA key processing command
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 \&\fBopenssl\fR \fBrsa\fR
68 [\fB\-help\fR]
69 [\fB\-inform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR]
70 [\fB\-outform\fR \fBDER\fR|\fBPEM\fR]
71 [\fB\-in\fR \fIfilename\fR|\fIuri\fR]
72 [\fB\-passin\fR \fIarg\fR]
73 [\fB\-out\fR \fIfilename\fR]
74 [\fB\-passout\fR \fIarg\fR]
75 [\fB\-aes128\fR]
76 [\fB\-aes192\fR]
77 [\fB\-aes256\fR]
78 [\fB\-aria128\fR]
79 [\fB\-aria192\fR]
80 [\fB\-aria256\fR]
81 [\fB\-camellia128\fR]
82 [\fB\-camellia192\fR]
83 [\fB\-camellia256\fR]
84 [\fB\-des\fR]
85 [\fB\-des3\fR]
86 [\fB\-idea\fR]
87 [\fB\-text\fR]
88 [\fB\-noout\fR]
89 [\fB\-modulus\fR]
90 [\fB\-traditional\fR]
91 [\fB\-check\fR]
92 [\fB\-pubin\fR]
93 [\fB\-pubout\fR]
94 [\fB\-RSAPublicKey_in\fR]
95 [\fB\-RSAPublicKey_out\fR]
96 [\fB\-pvk\-strong\fR]
97 [\fB\-pvk\-weak\fR]
98 [\fB\-pvk\-none\fR]
99 [\fB\-engine\fR \fIid\fR]
100 [\fB\-provider\fR \fIname\fR]
101 [\fB\-provider\-path\fR \fIpath\fR]
102 [\fB\-provparam\fR \fI[name:]key=value\fR]
103 [\fB\-propquery\fR \fIpropq\fR]
104 .SH DESCRIPTION
105 .IX Header "DESCRIPTION"
106 This command processes RSA keys. They can be converted between
107 various forms and their components printed out.
108 .SH OPTIONS
109 .IX Header "OPTIONS"
110 .IP \fB\-help\fR 4
111 .IX Item "-help"
112 Print out a usage message.
113 .IP "\fB\-inform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR" 4
114 .IX Item "-inform DER|PEM|P12|ENGINE"
115 The key input format; unspecified by default.
116 See \fBopenssl\-format\-options\fR\|(1) for details.
117 .IP "\fB\-outform\fR \fBDER\fR|\fBPEM\fR" 4
118 .IX Item "-outform DER|PEM"
119 The key output format; the default is \fBPEM\fR.
120 See \fBopenssl\-format\-options\fR\|(1) for details.
121 .IP \fB\-traditional\fR 4
122 .IX Item "-traditional"
123 When writing a private key, use the traditional PKCS#1 format
124 instead of the PKCS#8 format.
125 .IP "\fB\-in\fR \fIfilename\fR|\fIuri\fR" 4
126 .IX Item "-in filename|uri"
127 This specifies the input to read a key from or standard input if this
128 option is not specified. If the key is encrypted a pass phrase will be
129 prompted for.
130 .IP "\fB\-passin\fR \fIarg\fR, \fB\-passout\fR \fIarg\fR" 4
131 .IX Item "-passin arg, -passout arg"
132 The password source for the input and output file.
133 For more information about the format of \fBarg\fR
134 see \fBopenssl\-passphrase\-options\fR\|(1).
135 .IP "\fB\-out\fR \fIfilename\fR" 4
136 .IX Item "-out filename"
137 This specifies the output filename to write a key to or standard output if this
138 option is not specified. If any encryption options are set then a pass phrase
139 will be prompted for. The output filename should \fBnot\fR be the same as the input
140 filename.
141 .IP "\fB\-aes128\fR, \fB\-aes192\fR, \fB\-aes256\fR, \fB\-aria128\fR, \fB\-aria192\fR, \fB\-aria256\fR, \fB\-camellia128\fR, \fB\-camellia192\fR, \fB\-camellia256\fR, \fB\-des\fR, \fB\-des3\fR, \fB\-idea\fR" 4
142 .IX Item "-aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128, -camellia192, -camellia256, -des, -des3, -idea"
143 These options encrypt the private key with the specified
144 cipher before outputting it. A pass phrase is prompted for.
145 If none of these options is specified the key is written in plain text. This
146 means that this command can be used to remove the pass phrase from a key
147 by not giving any encryption option is given, or to add or change the pass
148 phrase by setting them.
149 These options can only be used with PEM format output files.
150 .IP \fB\-text\fR 4
151 .IX Item "-text"
152 Prints out the various public or private key components in
153 plain text in addition to the encoded version.
154 .IP \fB\-noout\fR 4
155 .IX Item "-noout"
156 This option prevents output of the encoded version of the key.
157 .IP \fB\-modulus\fR 4
158 .IX Item "-modulus"
159 This option prints out the value of the modulus of the key.
160 .IP \fB\-check\fR 4
161 .IX Item "-check"
162 This option checks the consistency of an RSA private key.
163 .IP \fB\-pubin\fR 4
164 .IX Item "-pubin"
165 By default a private key is read from the input.
166 With this option a public key is read instead.
167 If the input contains no public key but a private key, its public part is used.
168 .IP \fB\-pubout\fR 4
169 .IX Item "-pubout"
170 By default a private key is output: with this option a public
171 key will be output instead. This option is automatically set if
172 the input is a public key.
173 .IP "\fB\-RSAPublicKey_in\fR, \fB\-RSAPublicKey_out\fR" 4
174 .IX Item "-RSAPublicKey_in, -RSAPublicKey_out"
175 Like \fB\-pubin\fR and \fB\-pubout\fR except \fBRSAPublicKey\fR format is used instead.
176 .IP \fB\-pvk\-strong\fR 4
177 .IX Item "-pvk-strong"
178 Enable 'Strong' PVK encoding level (default).
179 .IP \fB\-pvk\-weak\fR 4
180 .IX Item "-pvk-weak"
181 Enable 'Weak' PVK encoding level.
182 .IP \fB\-pvk\-none\fR 4
183 .IX Item "-pvk-none"
184 Don't enforce PVK encoding.
185 .IP "\fB\-engine\fR \fIid\fR" 4
186 .IX Item "-engine id"
187 See "Engine Options" in \fBopenssl\fR\|(1).
188 This option is deprecated.
189 .IP "\fB\-provider\fR \fIname\fR" 4
190 .IX Item "-provider name"
191 .PD 0
192 .IP "\fB\-provider\-path\fR \fIpath\fR" 4
193 .IX Item "-provider-path path"
194 .IP "\fB\-provparam\fR \fI[name:]key=value\fR" 4
195 .IX Item "-provparam [name:]key=value"
196 .IP "\fB\-propquery\fR \fIpropq\fR" 4
197 .IX Item "-propquery propq"
198 .PD
199 See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
200 .SH NOTES
201 .IX Header "NOTES"
202 The \fBopenssl\-pkey\fR\|(1) command is capable of performing all the operations
203 this command can, as well as supporting other public key types.
204 .SH EXAMPLES
205 .IX Header "EXAMPLES"
206 The documentation for the \fBopenssl\-pkey\fR\|(1) command contains examples
207 equivalent to the ones listed here.
208 .PP
209 To remove the pass phrase on an RSA private key:
210 .PP
211 .Vb 1
212 \& openssl rsa \-in key.pem \-out keyout.pem
213 .Ve
214 .PP
215 To encrypt a private key using triple DES:
216 .PP
217 .Vb 1
218 \& openssl rsa \-in key.pem \-des3 \-out keyout.pem
219 .Ve
220 .PP
221 To convert a private key from PEM to DER format:
222 .PP
223 .Vb 1
224 \& openssl rsa \-in key.pem \-outform DER \-out keyout.der
225 .Ve
226 .PP
227 To print out the components of a private key to standard output:
228 .PP
229 .Vb 1
230 \& openssl rsa \-in key.pem \-text \-noout
231 .Ve
232 .PP
233 To just output the public part of a private key:
234 .PP
235 .Vb 1
236 \& openssl rsa \-in key.pem \-pubout \-out pubkey.pem
237 .Ve
238 .PP
239 Output the public part of a private key in \fBRSAPublicKey\fR format:
240 .PP
241 .Vb 1
242 \& openssl rsa \-in key.pem \-RSAPublicKey_out \-out pubkey.pem
243 .Ve
244 .SH BUGS
245 .IX Header "BUGS"
246 There should be an option that automatically handles \fI.key\fR files,
247 without having to manually edit them.
248 .SH "SEE ALSO"
249 .IX Header "SEE ALSO"
250 \&\fBopenssl\fR\|(1),
251 \&\fBopenssl\-pkey\fR\|(1),
252 \&\fBopenssl\-pkcs8\fR\|(1),
253 \&\fBopenssl\-dsa\fR\|(1),
254 \&\fBopenssl\-genrsa\fR\|(1),
255 \&\fBopenssl\-gendsa\fR\|(1)
256 .SH HISTORY
257 .IX Header "HISTORY"
258 The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
259 .SH COPYRIGHT
260 .IX Header "COPYRIGHT"
261 Copyright 2000\-2023 The OpenSSL Project Authors. All Rights Reserved.
262 .PP
263 Licensed under the Apache License 2.0 (the "License"). You may not use
264 this file except in compliance with the License. You can obtain a copy
265 in the file LICENSE in the source distribution or at
266 <https://www.openssl.org/source/license.html>.