Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man1/mac.1
Real path: /usr/share/man/man1/mac.1
Zurück
'\" te .\" Copyright (c) 2007, 2021, Oracle and/or its affiliates. .TH mac 1 "21 Jun 2021" "Oracle Solaris 11.4" "User Commands" .SH NAME mac \- calculate message authentication codes of the input .SH SYNOPSIS .LP .nf \fB/usr/bin/mac\fR \fB-l\fR .fi .LP .nf \fB/usr/bin/mac\fR [\fB-v\fR] \fB-a\fR \fIalgorithm\fR [\fB-t\fR \fItruncation\fR] [\fB-k\fR \fIkeyfile\fR | \fB-K\fR \fIkey_label\fR [\fB-T\fR \fItoken_spec\fR]] [\fIfile\fR]... .fi .SH DESCRIPTION .sp .LP The \fBmac\fR utility calculates the message authentication code (\fBMAC\fR) of the given file or files using the algorithm specified. .sp .LP If no input file is specified, input is read from standard input. If more than one file is given, each line of output is the \fBMAC\fR of a single file. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-a\fR \fIalgorithm\fR\fR .ad .RS 17n .rt Specifies the name of the algorithm to use during the encryption or decryption process. See USAGE, \fBAlgorithms\fR for details. \fBNote:\fR Algorithms for producing general length \fBMAC\fRs are not supported. .RE .sp .ne 2 .mk .na \fB\fB-k\fR \fIkeyfile\fR\fR .ad .RS 17n .rt Specifies the file containing the key value for the encryption algorithm. Each algorithm has specific key material requirements, as stated in the PKCS#11 specification. If \fB-k\fR is not specified, \fBmac\fR prompts for key material using \fBgetpassphrase\fR(3C). .sp For information on generating a key file, see the \fBpktool\fR(1) and \fBdd\fR(8) man pages. .RE .sp .ne 2 .mk .na \fB\fB-K\fR \fIkey_label\fR\fR .ad .RS 17n .rt Specify the label of a symmetric token key in a PKCS#11 token. .RE .sp .ne 2 .mk .na \fB\fB-l\fR\fR .ad .RS 17n .rt Displays the list of algorithms available on the system. This list can change depending on the configuration of the cryptographic framework. The keysizes are displayed in bits. .RE .sp .ne 2 .mk .na \fB\fB-T\fR \fItoken_spec\fR\fR .ad .RS 17n .rt Specify a PKCS#11 token other than the default soft token object store when the \fB-K\fR is specified. .sp \fItoken_spec\fR has the format of: .sp .sp .in +2 .nf \fItoken_name\fR \fB[:\fR\fImanuf_id\fR \fB[:\fR\fIserial_no\fR\fB]]\fR .fi .in -2 .sp When a token label contains trailing spaces, this option does not require them to be typed as a convenience to the user. .sp Colon separates token identification string. If any of the parts have a literal colon (\fB:\fR) character, it must be escaped by a backslash (\fB\e\fR). If a colon (\fB:\fR) is not found, the entire string (up to 32 characters) is taken as the token label. If only one colon (\fB:\fR) is found, the string is the token label and the manufacturer. .RE .sp .ne 2 .mk .na \fB\fB-t\fR \fItruncation\fR\fR .ad .RS 17n .rt Specifies the digest truncation length, where \fBt\fR is any positive number less than 512. Valid only for algorithm \fBsha512_t_hmac\fR. .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 17n .rt Provides verbose information. .RE .SH USAGE .SS "Algorithms" .sp .LP The supported algorithms are displayed with the \fB-l\fR option. These algorithms are provided by the cryptographic framework. Each supported algorithm is an alias to the most commonly used and least restricted version of a particular algorithm type. For example, \fBmd5_hmac\fR is an alias to \fBCKM_MD5_HMAC\fR. .sp .LP These aliases are used with the \fB-a\fR option and are case-sensitive. .SS "Passphrase" .sp .LP When the \fB-k\fR option is not used during encryption and decryption tasks, the user is prompted for a passphrase. The passphrase is manipulated into a more secure key using the \fBPBKDF2\fR algorithm specified in PKCS #5. .SH EXAMPLES .LP \fBExample 1\fR Listing Available Algorithms .sp .LP The following example lists available algorithms: .sp .in +2 .nf example$ \fBmac -l\fR Algorithm Keysize: Min Max (bits) ----------------------------------- sha1_hmac 8 512 md5_hmac 8 512 sha224_hmac 8 512 sha256_hmac 8 512 sha384_hmac 8 1024 sha512_hmac 8 1024 sha512_t_hmac 8 1024 .fi .in -2 .sp .LP \fBExample 2\fR Getting the Message Authentication Code .sp .LP The following example gets the message authentication code for a file: .sp .in +2 .nf example$ \fBmac -v -k mykey -a sha1_hmac /export/foo\fR sha1_hmac (/export/foo) = 913ced311df10f1708d9848641ca8992f4718057 .fi .in -2 .sp .LP \fBExample 3\fR Getting the Message Authentication Code with a Token Key .sp .LP The following example gets the message authentication code with a generic token key in the soft token keystore. The generic token key can be generated with \fBpktool\fR(1): .sp .in +2 .nf example$ \fBmac -v -a sha1_hmac -K my_generic_key \e -T "Sun Software PKCS#11 softtoken" /export/foo\fR Enter pin for Sun Software PKCS#11 softtoken: sha1_hmac (/etc/foo) = c2ba5c38458c092a68940081240d22b670182968 .fi .in -2 .sp .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 7n .rt Successful completion. .RE .sp .ne 2 .mk .na \fB\fB> 0\fR\fR .ad .RS 7n .rt An error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Availability system/core-os _ Interface Stability Committed .TE .sp .SH SEE ALSO .sp .LP \fBdigest\fR(1), \fBpktool\fR(1), \fBgetpassphrase\fR(3C), \fBlibpkcs11\fR(3LIB), \fBattributes\fR(7), \fBpkcs11_softtoken\fR(7), \fBdd\fR(8) .sp .LP Kaliski, B., \fIRFC 2898, PKCS #5: Password-Based Cryptography Specification, Version 2.0\fR, September 2000. https://tools.ietf.org/html/rfc2898 .sp .LP https://www.oasis-open.org/committees/pkcs11/ .SH HISTORY .sp .LP Support for the \fBdes_mac\fR algorithm was removed in Oracle Solaris 11.4.0. .sp .LP The \fB-t\fR option and \fBsha512_t_hmac\fR algorithm were added in Solaris 11.4.0. .sp .LP The \fBsha224_hmac\fR algorithm was added in Solaris 11.1.0. .sp .LP The \fB-K\fR and \fB-T\fR options were added in Solaris 11.0.0. .sp .LP The SHA-2 algorithms \fBsha256_hmac\fR, \fBsha384_hmac\fR, and \fBsha512_hmac\fR were added in Solaris 10 6/06 (Update 2). .sp .LP The \fBmac\fR command, and all other other algorithms & options, were added in Solaris 10 3/05.