晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /usr/share/doc/sscg/ |
Upload File : |
# SSCG - Simple Signed Certificate Generator
<a href="https://scan.coverity.com/projects/sscg">
<img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/12070/badge.svg"/>
</a>
## Why?
x509 Certificates are complicated to get right. SSCG makes it easy to generate usable, _signed_ certificates quickly without needing to understand complex `openssl`, `certtool` or `certutil` commands.
## Quick Usage - Certificates Signed by a Private CA
```
/usr/bin/sscg
````
This will produce a `ca.crt` and a pair of `service.pem` and `service-key.pem` files in the current directory, the latter of which is signed by the private key of the `ca.crt`. The CA's private key will be destroyed by default after these files are created, so nothing further can be signed by it. (See [this blog post](https://sgallagh.wordpress.com/2016/05/02/self-signed-ssltls-certificates-why-they-are-terrible-and-a-better-alternative/) for details on why this is desirable.)
Certificates generated by SSCG will be valid by default for securing the current machine's hostname and no others. To add further names (such as for a multi-homed system), look at the `--subject-alt-name` argument below.
## Full Usage
Usage of sscg:
```
Usage: sscg [OPTION...]
-q, --quiet Display no output unless there is an error.
-v, --verbose Display progress messages.
-d, --debug Enable logging of debug messages. Implies verbose. Warning! This will print
private key information to the screen!
-V, --version Display the version number and exit.
-f, --force Overwrite any pre-existing files in the requested locations
--lifetime=1-3650 Certificate lifetime (days). (default: 398)
--country=US, CZ, etc. Certificate DN: Country (C). (default: "US")
--state=Massachusetts, British Columbia, etc. Certificate DN: State or Province (ST).
--locality=Westford, Paris, etc. Certificate DN: Locality (L).
--organization=My Company Certificate DN: Organization (O). (default: "Unspecified")
--organizational-unit=Engineering, etc. Certificate DN: Organizational Unit (OU).
--email=myname@example.com Certificate DN: Email Address (Email).
--hostname=server.example.com The valid hostname of the certificate. Must be an FQDN. (default: current system
FQDN)
--subject-alt-name alt.example.com Optional additional valid hostnames for the certificate. In addition to hostnames,
this option also accepts explicit values supported by RFC 5280 such as
IP:xxx.xxx.xxx.xxx/yyy.yyy.yyy.yyy May be specified multiple times.
--package=STRING Unused. Retained for compatibility with earlier versions of sscg.
--key-strength=2048 or larger Strength of the certificate private keys in bits. (default: 2048)
--hash-alg={sha256,sha384,sha512} Hashing algorithm to use for signing. (default: "sha256")
--cipher-alg={des-ede3-cbc,aes-256-cbc} Cipher to use for encrypting key files. (default: "aes-256-cbc")
--ca-file=STRING Path where the public CA certificate will be stored. (default: "./ca.crt")
--ca-mode=0644 File mode of the created CA certificate.
--ca-key-file=STRING Path where the CA's private key will be stored. If unspecified, the key will be
destroyed rather than written to the disk.
--ca-key-mode=0600 File mode of the created CA key.
--ca-key-password=STRING Provide a password for the CA key file. Note that this will be visible in the
process table for all users, so it should be used for testing purposes only. Use
--ca-keypassfile or --ca-key-password-prompt for secure password entry.
--ca-key-passfile=STRING A file containing the password to encrypt the CA key file.
-C, --ca-key-password-prompt Prompt to enter a password for the CA key file.
--crl-file=STRING Path where an (empty) Certificate Revocation List file will be created, for
applications that expect such a file to exist. If unspecified, no such file will
be created.
--crl-mode=0644 File mode of the created Certificate Revocation List.
--cert-file=STRING Path where the public service certificate will be stored. (default "./service.pem")
--cert-mode=0644 File mode of the created certificate.
--cert-key-file=STRING Path where the service's private key will be stored. (default "service-key.pem")
--cert-key-mode=0600 File mode of the created certificate key.
-p, --cert-key-password=STRING Provide a password for the service key file. Note that this will be visible in the
process table for all users, so this flag should be used for testing purposes
only. Use --cert-keypassfile or --cert-key-password-prompt for secure password
entry.
--cert-key-passfile=STRING A file containing the password to encrypt the service key file.
-P, --cert-key-password-prompt Prompt to enter a password for the service key file.
--client-file=STRING Path where a client authentication certificate will be stored.
--client-mode=0644 File mode of the created certificate.
--client-key-file=STRING Path where the client's private key will be stored. (default is the client-file)
--client-key-mode=0600 File mode of the created certificate key.
--client-key-password=STRING Provide a password for the client key file. Note that this will be visible in the
process table for all users, so this flag should be used for testing purposes
only. Use --client-keypassfile or --client-key-password-prompt for secure password
entry.
--client-key-passfile=STRING A file containing the password to encrypt the client key file.
--client-key-password-prompt Prompt to enter a password for the client key file.
--dhparams-file=STRING A file to contain a set of Diffie-Hellman parameters. (Default: "./dhparams.pem")
--dhparams-named-group=STRING Output well-known DH parameters. The available named groups are: ffdhe2048,
ffdhe3072, ffdhe4096, ffdhe6144, ffdhe8192, modp_2048, modp_3072, modp_4096,
modp_6144, modp_8192, modp_1536, dh_1024_160, dh_2048_224, dh_2048_256. (Default:
"ffdhe4096")
--dhparams-prime-len=INT The length of the prime number to generate for dhparams, in bits. If set to
non-zero, the parameters will be generated rather than using a well-known group.
(default: 0)
--dhparams-generator={2,3,5} The generator value for dhparams. (default: 2)
Help options:
-?, --help Show this help message
--usage Display brief usage message
```
For developers, you can run with the environment variable `SSCG_TALLOC_REPORT=true` to get a memory leak report.