VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.3/doc/man1/openssl-dgst.pod.in@ 96159

最後變更 在這個檔案從96159是 94404,由 vboxsync 提交於 3 年 前

libs/openssl: Update to 3.0.2 and switch to it, bugref:10128

檔案大小: 7.3 KB
 
1=pod
2{- OpenSSL::safe::output_do_not_edit_headers(); -}
3
4=head1 NAME
5
6openssl-dgst - perform digest operations
7
8=head1 SYNOPSIS
9
10B<openssl> B<dgst>|I<digest>
11[B<-I<digest>>]
12[B<-list>]
13[B<-help>]
14[B<-c>]
15[B<-d>]
16[B<-debug>]
17[B<-hex>]
18[B<-binary>]
19[B<-xoflen> I<length>]
20[B<-r>]
21[B<-out> I<filename>]
22[B<-sign> I<filename>|I<uri>]
23[B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
24[B<-passin> I<arg>]
25[B<-verify> I<filename>]
26[B<-prverify> I<filename>]
27[B<-signature> I<filename>]
28[B<-sigopt> I<nm>:I<v>]
29[B<-hmac> I<key>]
30[B<-mac> I<alg>]
31[B<-macopt> I<nm>:I<v>]
32[B<-fips-fingerprint>]
33{- $OpenSSL::safe::opt_engine_synopsis -}{- output_off() if $disabled{"deprecated-3.0"}; ""
34-}[B<-engine_impl> I<id>]{-
35 output_on() if $disabled{"deprecated-3.0"}; "" -}
36{- $OpenSSL::safe::opt_r_synopsis -}
37{- $OpenSSL::safe::opt_provider_synopsis -}
38[I<file> ...]
39
40=head1 DESCRIPTION
41
42This command output the message digest of a supplied file or files
43in hexadecimal, and also generates and verifies digital
44signatures using message digests.
45
46The generic name, B<openssl dgst>, may be used with an option specifying the
47algorithm to be used.
48The default digest is B<sha256>.
49A supported I<digest> name may also be used as the sub-command name.
50To see the list of supported algorithms, use C<openssl list -digest-algorithms>
51
52=head1 OPTIONS
53
54=over 4
55
56=item B<-help>
57
58Print out a usage message.
59
60=item B<-I<digest>>
61
62Specifies name of a supported digest to be used. See option B<-list> below :
63
64=item B<-list>
65
66Prints out a list of supported message digests.
67
68=item B<-c>
69
70Print out the digest in two digit groups separated by colons, only relevant if
71the B<-hex> option is given as well.
72
73=item B<-d>, B<-debug>
74
75Print out BIO debugging information.
76
77=item B<-hex>
78
79Digest is to be output as a hex dump. This is the default case for a "normal"
80digest as opposed to a digital signature. See NOTES below for digital
81signatures using B<-hex>.
82
83=item B<-binary>
84
85Output the digest or signature in binary form.
86
87=item B<-xoflen> I<length>
88
89Set the output length for XOF algorithms, such as B<shake128>.
90
91=item B<-r>
92
93=for openssl foreign manual sha1sum(1)
94
95Output the digest in the "coreutils" format, including newlines.
96Used by programs like L<sha1sum(1)>.
97
98=item B<-out> I<filename>
99
100Filename to output to, or standard output by default.
101
102=item B<-sign> I<filename>|I<uri>
103
104Digitally sign the digest using the given private key. Note this option
105does not support Ed25519 or Ed448 private keys. Use the L<openssl-pkeyutl(1)>
106command instead for this.
107
108=item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
109
110The format of the key to sign with; unspecified by default.
111See L<openssl-format-options(1)> for details.
112
113=item B<-sigopt> I<nm>:I<v>
114
115Pass options to the signature algorithm during sign or verify operations.
116Names and values of these options are algorithm-specific.
117
118=item B<-passin> I<arg>
119
120The private key password source. For more information about the format of I<arg>
121see L<openssl-passphrase-options(1)>.
122
123=item B<-verify> I<filename>
124
125Verify the signature using the public key in "filename".
126The output is either "Verified OK" or "Verification Failure".
127
128=item B<-prverify> I<filename>
129
130Verify the signature using the private key in "filename".
131
132=item B<-signature> I<filename>
133
134The actual signature to verify.
135
136=item B<-hmac> I<key>
137
138Create a hashed MAC using "key".
139
140The L<openssl-mac(1)> command should be preferred to using this command line
141option.
142
143=item B<-mac> I<alg>
144
145Create MAC (keyed Message Authentication Code). The most popular MAC
146algorithm is HMAC (hash-based MAC), but there are other MAC algorithms
147which are not based on hash, for instance B<gost-mac> algorithm,
148supported by the B<gost> engine. MAC keys and other options should be set
149via B<-macopt> parameter.
150
151The L<openssl-mac(1)> command should be preferred to using this command line
152option.
153
154=item B<-macopt> I<nm>:I<v>
155
156Passes options to MAC algorithm, specified by B<-mac> key.
157Following options are supported by both by B<HMAC> and B<gost-mac>:
158
159=over 4
160
161=item B<key>:I<string>
162
163Specifies MAC key as alphanumeric string (use if key contain printable
164characters only). String length must conform to any restrictions of
165the MAC algorithm for example exactly 32 chars for gost-mac.
166
167=item B<hexkey>:I<string>
168
169Specifies MAC key in hexadecimal form (two hex digits per byte).
170Key length must conform to any restrictions of the MAC algorithm
171for example exactly 32 chars for gost-mac.
172
173=back
174
175The L<openssl-mac(1)> command should be preferred to using this command line
176option.
177
178=item B<-fips-fingerprint>
179
180Compute HMAC using a specific key for certain OpenSSL-FIPS operations.
181
182{- $OpenSSL::safe::opt_r_item -}
183
184{- $OpenSSL::safe::opt_engine_item -}
185{- output_off() if $disabled{"deprecated-3.0"}; "" -}
186The engine is not used for digests unless the B<-engine_impl> option is
187used or it is configured to do so, see L<config(5)/Engine Configuration Module>.
188
189=item B<-engine_impl> I<id>
190
191When used with the B<-engine> option, it specifies to also use
192engine I<id> for digest operations.
193
194{- output_on() if $disabled{"deprecated-3.0"}; "" -}
195{- $OpenSSL::safe::opt_provider_item -}
196
197=item I<file> ...
198
199File or files to digest. If no files are specified then standard input is
200used.
201
202=back
203
204
205=head1 EXAMPLES
206
207To create a hex-encoded message digest of a file:
208
209 openssl dgst -md5 -hex file.txt
210 or
211 openssl md5 file.txt
212
213To sign a file using SHA-256 with binary file output:
214
215 openssl dgst -sha256 -sign privatekey.pem -out signature.sign file.txt
216 or
217 openssl sha256 -sign privatekey.pem -out signature.sign file.txt
218
219To verify a signature:
220
221 openssl dgst -sha256 -verify publickey.pem \
222 -signature signature.sign \
223 file.txt
224
225
226=head1 NOTES
227
228The digest mechanisms that are available will depend on the options
229used when building OpenSSL.
230The C<openssl list -digest-algorithms> command can be used to list them.
231
232New or agile applications should use probably use SHA-256. Other digests,
233particularly SHA-1 and MD5, are still widely used for interoperating
234with existing formats and protocols.
235
236When signing a file, this command will automatically determine the algorithm
237(RSA, ECC, etc) to use for signing based on the private key's ASN.1 info.
238When verifying signatures, it only handles the RSA, DSA, or ECDSA signature
239itself, not the related data to identify the signer and algorithm used in
240formats such as x.509, CMS, and S/MIME.
241
242A source of random numbers is required for certain signing algorithms, in
243particular ECDSA and DSA.
244
245The signing and verify options should only be used if a single file is
246being signed or verified.
247
248Hex signatures cannot be verified using B<openssl>. Instead, use "xxd -r"
249or similar program to transform the hex signature into a binary signature
250prior to verification.
251
252The L<openssl-mac(1)> command is preferred over the B<-hmac>, B<-mac> and
253B<-macopt> command line options.
254
255=head1 SEE ALSO
256
257L<openssl-mac(1)>
258
259=head1 HISTORY
260
261The default digest was changed from MD5 to SHA256 in OpenSSL 1.1.0.
262The FIPS-related options were removed in OpenSSL 1.1.0.
263
264The B<-engine> and B<-engine_impl> options were deprecated in OpenSSL 3.0.
265
266=head1 COPYRIGHT
267
268Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
269
270Licensed under the Apache License 2.0 (the "License"). You may not use
271this file except in compliance with the License. You can obtain a copy
272in the file LICENSE in the source distribution or at
273L<https://www.openssl.org/source/license.html>.
274
275=cut
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette