1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
18 .\" Set up some character translations and predefined strings. \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
53 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
65 . \" fudge factors for nroff and troff
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 . \" simple accents for nroff and troff
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
97 . \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 . \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 . \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
124 .\" ========================================================================
126 .IX Title "PKEYUTL 1"
127 .TH PKEYUTL 1 "2014-04-07" "1.0.1g" "OpenSSL"
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
133 pkeyutl \- public key algorithm utility
135 .IX Header "SYNOPSIS"
136 \&\fBopenssl\fR \fBpkeyutl\fR
139 [\fB\-sigfile file\fR]
141 [\fB\-keyform PEM|DER\fR]
143 [\fB\-peerkey file\fR]
144 [\fB\-peerform PEM|DER\fR]
150 [\fB\-verifyrecover\fR]
154 [\fB\-pkeyopt opt:value\fR]
159 .IX Header "DESCRIPTION"
160 The \fBpkeyutl\fR command can be used to perform public key operations using
161 any supported algorithm.
162 .SH "COMMAND OPTIONS"
163 .IX Header "COMMAND OPTIONS"
164 .IP "\fB\-in filename\fR" 4
165 .IX Item "-in filename"
166 This specifies the input filename to read data from or standard input
167 if this option is not specified.
168 .IP "\fB\-out filename\fR" 4
169 .IX Item "-out filename"
170 specifies the output filename to write to or standard output by
172 .IP "\fB\-inkey file\fR" 4
173 .IX Item "-inkey file"
174 the input key file, by default it should be a private key.
175 .IP "\fB\-keyform PEM|DER\fR" 4
176 .IX Item "-keyform PEM|DER"
177 the key format \s-1PEM\s0, \s-1DER\s0 or \s-1ENGINE\s0.
178 .IP "\fB\-passin arg\fR" 4
179 .IX Item "-passin arg"
180 the input key password source. For more information about the format of \fBarg\fR
181 see the \fB\s-1PASS\s0 \s-1PHRASE\s0 \s-1ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
182 .IP "\fB\-peerkey file\fR" 4
183 .IX Item "-peerkey file"
184 the peer key file, used by key derivation (agreement) operations.
185 .IP "\fB\-peerform PEM|DER\fR" 4
186 .IX Item "-peerform PEM|DER"
187 the peer key format \s-1PEM\s0, \s-1DER\s0 or \s-1ENGINE\s0.
188 .IP "\fB\-engine id\fR" 4
189 .IX Item "-engine id"
190 specifying an engine (by its unique \fBid\fR string) will cause \fBpkeyutl\fR
191 to attempt to obtain a functional reference to the specified engine,
192 thus initialising it if needed. The engine will then be set as the default
193 for all available algorithms.
194 .IP "\fB\-pubin\fR" 4
196 the input file is a public key.
197 .IP "\fB\-certin\fR" 4
199 the input is a certificate containing a public key.
202 reverse the order of the input buffer. This is useful for some libraries
203 (such as CryptoAPI) which represent the buffer in little endian format.
206 sign the input data and output the signed result. This requires
208 .IP "\fB\-verify\fR" 4
210 verify the input data against the signature file and indicate if the
211 verification succeeded or failed.
212 .IP "\fB\-verifyrecover\fR" 4
213 .IX Item "-verifyrecover"
214 verify the input data and output the recovered data.
215 .IP "\fB\-encrypt\fR" 4
217 encrypt the input data using a public key.
218 .IP "\fB\-decrypt\fR" 4
220 decrypt the input data using a private key.
221 .IP "\fB\-derive\fR" 4
223 derive a shared secret using the peer key.
224 .IP "\fB\-hexdump\fR" 4
226 hex dump the output data.
227 .IP "\fB\-asn1parse\fR" 4
228 .IX Item "-asn1parse"
229 asn1parse the output data, this is useful when combined with the
230 \&\fB\-verifyrecover\fR option when an \s-1ASN1\s0 structure is signed.
233 The operations and options supported vary according to the key algorithm
234 and its implementation. The OpenSSL operations and options are indicated below.
236 Unless otherwise mentioned all algorithms support the \fBdigest:alg\fR option
237 which specifies the digest in use for sign, verify and verifyrecover operations.
238 The value \fBalg\fR should represent a digest name as used in the
239 \&\fIEVP_get_digestbyname()\fR function for example \fBsha1\fR.
241 .IX Header "RSA ALGORITHM"
242 The \s-1RSA\s0 algorithm supports encrypt, decrypt, sign, verify and verifyrecover
243 operations in general. Some padding modes only support some of these
245 .IP "\-\fBrsa_padding_mode:mode\fR" 4
246 .IX Item "-rsa_padding_mode:mode"
247 This sets the \s-1RSA\s0 padding mode. Acceptable values for \fBmode\fR are \fBpkcs1\fR for
248 PKCS#1 padding, \fBsslv23\fR for SSLv23 padding, \fBnone\fR for no padding, \fBoaep\fR
249 for \fB\s-1OAEP\s0\fR mode, \fBx931\fR for X9.31 mode and \fBpss\fR for \s-1PSS\s0.
251 In PKCS#1 padding if the message digest is not set then the supplied data is
252 signed or verified directly instead of using a \fBDigestInfo\fR structure. If a
253 digest is set then the a \fBDigestInfo\fR structure is used and its the length
254 must correspond to the digest type.
256 For \fBoeap\fR mode only encryption and decryption is supported.
258 For \fBx931\fR if the digest type is set it is used to format the block data
259 otherwise the first byte is used to specify the X9.31 digest \s-1ID\s0. Sign,
260 verify and verifyrecover are can be performed in this mode.
262 For \fBpss\fR mode only sign and verify are supported and the digest type must be
264 .IP "\fBrsa_pss_saltlen:len\fR" 4
265 .IX Item "rsa_pss_saltlen:len"
266 For \fBpss\fR mode only this option specifies the salt length. Two special values
267 are supported: \-1 sets the salt length to the digest length. When signing \-2
268 sets the salt length to the maximum permissible value. When verifying \-2 causes
269 the salt length to be automatically determined based on the \fB\s-1PSS\s0\fR block
272 .IX Header "DSA ALGORITHM"
273 The \s-1DSA\s0 algorithm supports signing and verification operations only. Currently
274 there are no additional options other than \fBdigest\fR. Only the \s-1SHA1\s0
275 digest can be used and this digest is assumed by default.
277 .IX Header "DH ALGORITHM"
278 The \s-1DH\s0 algorithm only supports the derivation operation and no additional
281 .IX Header "EC ALGORITHM"
282 The \s-1EC\s0 algorithm supports sign, verify and derive operations. The sign and
283 verify operations use \s-1ECDSA\s0 and derive uses \s-1ECDH\s0. Currently there are no
284 additional options other than \fBdigest\fR. Only the \s-1SHA1\s0 digest can be used and
285 this digest is assumed by default.
287 .IX Header "EXAMPLES"
288 Sign some data using a private key:
291 \& openssl pkeyutl \-sign \-in file \-inkey key.pem \-out sig
294 Recover the signed data (e.g. if an \s-1RSA\s0 key is used):
297 \& openssl pkeyutl \-verifyrecover \-in sig \-inkey key.pem
300 Verify the signature (e.g. a \s-1DSA\s0 key):
303 \& openssl pkeyutl \-verify \-in file \-sigfile sig \-inkey key.pem
306 Sign data using a message digest value (this is currently only valid for \s-1RSA\s0):
309 \& openssl pkeyutl \-sign \-in file \-inkey key.pem \-out sig \-pkeyopt digest:sha256
312 Derive a shared secret value:
315 \& openssl pkeyutl \-derive \-inkey key.pem \-peerkey pubkey.pem \-out secret
318 .IX Header "SEE ALSO"
319 \&\fIgenpkey\fR\|(1), \fIpkey\fR\|(1), \fIrsautl\fR\|(1)
320 \&\fIdgst\fR\|(1), \fIrsa\fR\|(1), \fIgenrsa\fR\|(1)