=pod

=encoding utf8 

=head1 NAME

gmssl - GmSSL command line tool

=head1 SYNOPSIS

B<gmssl>
I<command>
[ I<command_opts> ]
[ I<command_args> ]

B<gmssl> B<list> [ B<standard-commands> | B<digest-commands> | B<cipher-commands> | B<cipher-algorithms> | B<digest-algorithms> | B<public-key-algorithms>]

B<gmssl> B<no->I<XXX> [ I<arbitrary options> ]

=head1 DESCRIPTION

GmSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
v2/v3) and Transport Layer Security (TLS v1) network protocols and related
cryptography standards required by them.

The B<gmssl> program is a command line tool for using the various
cryptography functions of GmSSL's B<crypto> library from the shell.
It can be used for

GmSSL是实现安全套接字层（SSL v2 / v3）和传输层安全（TLS v1）网络协议
及其所需的相关加密标准的加密工具包。

 o  Creation and management of private keys, public keys and parameters
 o  Public key cryptographic operations
 o  Creation of X.509 certificates, CSRs and CRLs
 o  Calculation of Message Digests
 o  Encryption and Decryption with Ciphers
 o  SSL/TLS Client and Server Tests
 o  Handling of S/MIME signed or encrypted mail
 o  Time Stamp requests, generation and verification

创建并管理公钥，私钥和参数。

公钥加密操作。

x509，CSR和CRL的创建

计算消息摘要。

密码加密解密

SSC/TLS客户端服务器的测试

处理S / MIME签名或加密的邮件

时间戳请求，生成和验证

=head1 COMMAND SUMMARY

The B<gmssl> program provides a rich variety of commands (I<command> in the
SYNOPSIS above), each of which often has a wealth of options and arguments
(I<command_opts> and I<command_args> in the SYNOPSIS).

The list parameters B<standard-commands>, B<digest-commands>,
and B<cipher-commands> output a list (one entry per line) of the names
of all standard commands, message digest commands, or cipher commands,
respectively, that are available in the present B<gmssl> utility.

The list parameters B<cipher-algorithms> and
B<digest-algorithms> list all cipher and message digest names, one entry per line. Aliases are listed as:

 from => to

The list parameter B<public-key-algorithms> lists all supported public
key algorithms.

The command B<no->I<XXX> tests whether a command of the
specified name is available.  If no command named I<XXX> exists, it
returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1
and prints I<XXX>.  In both cases, the output goes to B<stdout> and
nothing is printed to B<stderr>.  Additional command line arguments
are always ignored.  Since for each cipher there is a command of the
same name, this provides an easy way for shell scripts to test for the
availability of ciphers in the B<gmssl> program.  (B<no->I<XXX> is
not able to detect pseudo-commands such as B<quit>,
B<list>, or B<no->I<XXX> itself.)

gmssl程序提供丰富多样的命令（上面的概要中的命令），每个命令通常具有
丰富的选项和参数（概要中的command_opts和command_args）。

列表参数standard-commands，digest-commands和cipher-commands分别输出
目前gmssl实用程序中可用的所有标准命令，消息摘要命令或密码命令的列表
（每行一个条目）。

列表参数密码算法和摘要算法列出所有密码和消息摘要名称，每行一个条目。

列表参数public-key-algorithms列出了所有支持的公钥算法。

命令no-XXX测试指定名称的命令是否可用。 如果没有命名为XXX的命令，
则返回0（成功），并打印no-XXX; 否则返回1并打印XXX。 在这两种情况下，
输出到stdout，没有什么打印到stderr。 其他命令行参数始终被忽略。 
因为每个密码都有一个相同名称的命令，这为shell脚本提供了一个简
单的方法来测试gmssl程序中密码的可用性。 （否 - XXX无法检测到伪命令
，如quit，list或no-XXX本身。）

=head2 Standard Commands

=over 10

=item L<B<asn1parse>|asn1parse(1)>

Parse an ASN.1 sequence.

解析ASN1序列

=item L<B<ca>|ca(1)>

Certificate Authority (CA) Management.

CA管理

=item L<B<ciphers>|ciphers(1)>

Cipher Suite Description Determination.

密码套件描述确定。

=item L<B<cms>|cms(1)>

CMS (Cryptographic Message Syntax) utility

CMS有效。

=item L<B<crl>|crl(1)>

Certificate Revocation List (CRL) Management.

CRL管理

=item L<B<crl2pkcs7>|crl2pkcs7(1)>

CRL to PKCS#7 Conversion.

CRL转变为PKCS#7

=item L<B<dgst>|dgst(1)>

Message Digest Calculation.

消息摘要计算

=item B<dh>

Diffie-Hellman Parameter Management.
Obsoleted by L<B<dhparam>|dhparam(1)>.

DH参数管理

=item L<B<dhparam>|dhparam(1)>

Generation and Management of Diffie-Hellman Parameters. Superseded by
L<B<genpkey>|genpkey(1)> and L<B<pkeyparam>|pkeyparam(1)>

Diffie-Hellman参数的生成与管理。 被genpkey和pkeyparam取代

=item L<B<dsa>|dsa(1)>

DSA Data Management.

DSA数据管理

=item L<B<dsaparam>|dsaparam(1)>

DSA Parameter Generation and Management. Superseded by
L<B<genpkey>|genpkey(1)> and L<B<pkeyparam>|pkeyparam(1)>

DSA参数的生成与管理

=item L<B<ec>|ec(1)>

EC/SM2 (Elliptic curve) key processing

EC/SM2密钥处理

=item L<B<ecparam>|ecparam(1)>

EC/SM2 parameter manipulation and generation

EC / SM2参数的操作和生成

=item L<B<enc>|enc(1)>

Encoding with Ciphers.

密码进行编码

=item L<B<engine>|engine(1)>

Engine (loadable module) information and manipulation.

引擎信息和操作

=item L<B<errstr>|errstr(1)>

Error Number to Error String Conversion.

错误字符串转换的错误编号

=item B<gendh>

Generation of Diffie-Hellman Parameters.
Obsoleted by L<B<dhparam>|dhparam(1)>.

生成Diffie-Hellman参数。 被dhparam淘汰。

=item L<B<gendsa>|gendsa(1)>

Generation of DSA Private Key from Parameters. Superseded by
L<B<genpkey>|genpkey(1)> and L<B<pkey>|pkey(1)>

生成从参数的DSA私钥，被genpkey pkey淘汰

=item L<B<genpkey>|genpkey(1)>

Generation of Private Key or Parameters.

私钥和参数的生成

=item L<B<genrsa>|genrsa(1)>

Generation of RSA Private Key. Superseded by L<B<genpkey>|genpkey(1)>.

RSA私钥的生成

=item L<B<nseq>|nseq(1)>

Create or examine a Netscape certificate sequence

创建或检查Netscape证书序列

=item L<B<ocsp>|ocsp(1)>

Online Certificate Status Protocol utility.

在线证书状态协议实用程序。

=item L<B<passwd>|passwd(1)>

Generation of hashed passwords.

哈希密码生成

=item L<B<pkcs12>|pkcs12(1)>

PKCS#12 Data Management.

PKCS#12 数据管理

=item L<B<pkcs7>|pkcs7(1)>

PKCS#7 Data Management.

PKCS#7 数据管理

=item L<B<pkey>|pkey(1)>

Public and private key management.

公私钥管理

=item L<B<pkeyparam>|pkeyparam(1)>

Public key algorithm parameter management.

公钥算法参数管理

=item L<B<pkeyutl>|pkeyutl(1)>

Public key algorithm cryptographic operation utility.

公钥算法加密运算实用程序。

=item L<B<rand>|rand(1)>

Generate pseudo-random bytes.

生成伪随机字节

=item L<B<req>|req(1)>

PKCS#10 X.509 Certificate Signing Request (CSR) Management.

PKCS#10 X509 CSR管理

=item L<B<rsa>|rsa(1)>

RSA key management.

RSA密钥管理

=item L<B<rsautl>|rsautl(1)>

RSA utility for signing, verification, encryption, and decryption. Superseded
by  L<B<pkeyutl>|pkeyutl(1)>

用于签名，验证，加密和解密的RSA实用程序。 取而代之的是pkeyutl

=item L<B<s_client>|s_client(1)>

This implements a generic SSL/TLS client which can establish a transparent
connection to a remote server speaking SSL/TLS. It's intended for testing
purposes only and provides only rudimentary interface functionality but
internally uses mostly all functionality of the GmSSL B<ssl> library.

这实现了通用的SSL / TLS客户端，可以建立与远程服务器的SSL / TLS的透明连接。 它仅用于测试目的，仅提供基本的接口功能，但内部主要使用GmSSL ssl库的所有功能。

=item L<B<s_server>|s_server(1)>

This implements a generic SSL/TLS server which accepts connections from remote
clients speaking SSL/TLS. It's intended for testing purposes only and provides
only rudimentary interface functionality but internally uses mostly all
functionality of the GmSSL B<ssl> library.  It provides both an own command
line oriented protocol for testing SSL functions and a simple HTTP response
facility to emulate an SSL/TLS-aware webserver.

这实现了一个通用的SSL / TLS服务器，它接受来自远程客户端的SSL / TLS连接。 它仅用于测试目的，仅提供基本的接口功能，但内部主要使用GmSSL ssl库的所有功能。 它提供了一个用于测试SSL功能的自己的面向命令行的协议和一个简单的HTTP响应工具来模拟一个支持SSL / TLS的Web服务器。

=item L<B<s_time>|s_time(1)>

SSL Connection Timer.

SSL连接计时器

=item L<B<sess_id>|sess_id(1)>

SSL Session Data Management.

SSL会议数据管理。

=item L<B<smime>|smime(1)>

S/MIME mail processing.

S/MIME 邮件处理

=item L<B<speed>|speed(1)>

Algorithm Speed Measurement.

算法速度测量

=item L<B<spkac>|spkac(1)>

SPKAC printing and generating utility

SPKAC打印和生成实用程序。

=item L<B<ts>|ts(1)>

Time Stamping Authority tool (client/server)

时间戳机构工具（客户端/服务器）

=item L<B<verify>|verify(1)>

X.509 Certificate Verification.

X.509证书验证

=item L<B<version>|version(1)>

GmSSL Version Information.

GmSSL 版本信息

=item L<B<x509>|x509(1)>

X.509 Certificate Data Management.

X.509证书数据管理

=back

=head2 Message Digest Commands

=over 10

=item B<sm3>

SM3 Digest

SM3摘要

=item B<md5>

MD5 Digest

MD5摘要

=item B<mdc2>

MDC2 Digest

MDC2摘要

=item B<rmd160>

RMD-160 Digest

RMD-160摘要

=item B<sha>

SHA Digest

SHA摘要

=item B<sha1>

SHA-1 Digest

SHA-1摘要

=item B<sha224>

SHA-224 Digest

SHA-224摘要

=item B<sha256>

SHA-256 Digest

SHA-256摘要

=item B<sha384>

SHA-384 Digest

SHA-384摘要

=item B<sha512>

SHA-512 Digest

SHA-512摘要

=back

=head2 Encoding and Cipher Commands

=over 10

=item B<base64>

Base64 Encoding

Base64 编码

=item B<sms4 sms4-cbc sms4-cfb sms4-ecb sms4-ofb>

SMS4 Cipher

SMS4密码

=item B<cast cast-cbc>

CAST Cipher

CAST密码

=item B<cast5-cbc cast5-cfb cast5-ecb cast5-ofb>

CAST5 Cipher

CAST5密码

=item B<des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb>

DES Cipher

DES密码

=item B<des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb>

Triple-DES Cipher

三重DES密码

=item B<idea idea-cbc idea-cfb idea-ecb idea-ofb>

IDEA Cipher

IDEA密码

=item B<rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb>

RC2 Cipher

RC2密码

=item B<rc4>

RC4 Cipher

RC4密码

=item B<rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb>

RC5 Cipher

RC5密码

=back

=head1 OPTIONS

Details of which options are available depend on the specific command.
This section describes some common options with common behavior.

哪些选项可用的详细信息取决于具体的命令。 本节介绍一些常见的常见选项。

=head2 Common Options

=over 10

=item B<-help>

Provides a terse summary of all options.

输出所有选项的摘要

=back

=head2 Pass Phrase Options

Several commands accept password arguments, typically using B<-passin>
and B<-passout> for input and output passwords respectively. These allow
the password to be obtained from a variety of sources. Both of these
options take a single argument whose format is described below. If no
password argument is given and a password is required then the user is
prompted to enter one: this will typically be read from the current
terminal with echoing turned off.

几个命令接受密码参数，通常分别使用-passin和-passout来输入和输出密码。 这些允许从各种来源获取密码。 这两个选项都有一个参数，其格式如下所述。 如果没有提供密码参数并且需要密码，则会提示用户输入密码：通常将从当前终端读取，并且回显关闭。

=over 10

=item B<pass:password>

the actual password is B<password>. Since the password is visible
to utilities (like 'ps' under Unix) this form should only be used
where security is not important.

实际的密码是password。 由于密码对于实用程序是可见的（例如Unix下的“ps”）
，因此只能在安全性不重要的地方使用此表单。

=item B<env:var>

obtain the password from the environment variable B<var>. Since
the environment of other processes is visible on certain platforms
(e.g. ps under certain Unix OSes) this option should be used with caution.

从环境变量var获取密码。 由于其他进程的环境在某些平台上可见（例如某些Unix操作系统下的ps），因此谨慎使用此选项。

=item B<file:pathname>

the first line of B<pathname> is the password. If the same B<pathname>
argument is supplied to B<-passin> and B<-passout> arguments then the first
line will be used for the input password and the next line for the output
password. B<pathname> need not refer to a regular file: it could for example
refer to a device or named pipe.

路径名的第一行是密码。 如果相同的pathname参数提供给-passin和-passout参数，
则第一行将用于输入密码，输出密码的下一行将被使用。 路径名不需要引用常规文件：
例如可以参考设备或命名管道。

=item B<fd:number>

read the password from the file descriptor B<number>. This can be used to
send the data via a pipe for example.

从文件描述符编号读取密码。比方说这可以用于通过管道发送数据。

=item B<stdin>

read the password from standard input.

从标准输入读取密码。

=back

=head1 SEE ALSO

L<asn1parse(1)>, L<ca(1)>, L<config(5)>,
L<crl(1)>, L<crl2pkcs7(1)>, L<dgst(1)>,
L<dhparam(1)>, L<dsa(1)>, L<dsaparam(1)>,
L<enc(1)>, L<engine(1)>, L<gendsa(1)>, L<genpkey(1)>,
L<genrsa(1)>, L<nseq(1)>, L<gmssl(1)>,
L<passwd(1)>,
L<pkcs12(1)>, L<pkcs7(1)>, L<pkcs8(1)>,
L<rand(1)>, L<req(1)>, L<rsa(1)>,
L<rsautl(1)>, L<s_client(1)>,
L<s_server(1)>, L<s_time(1)>,
L<smime(1)>, L<spkac(1)>,
L<verify(1)>, L<version(1)>, L<x509(1)>,
L<crypto(7)>, L<ssl(7)>, L<x509v3_config(5)>

=head1 HISTORY

The B<list->I<XXX>B<-algorithms> pseudo-commands were added in GmSSL 1.0.0;
For notes on the availability of other commands, see their individual
manual pages.

=head1 COPYRIGHT

Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the GmSSL license (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
