SSCEP 是 SCEP 协议的命令行客户端
Copyright (c) Jarkko Turkulainen 2003. All rights reserved.
See the file COPYING for licensing information.
SSCEP is a client-only implementation of the SCEP (Cisco System's Simple Certificate Enrollment Protocol). SSCEP is designed for OpenBSD's isakmpd, but it will probably work with any Unix system with a recent compiler and OpenSSL toolkit libraries installed.
(From the Cisco Systems White Paper):
SCEP is a PKI communication protocol which leverages existing technology by using PKCS#7 and PKCS#10. SCEP is the evolution of the enrollment protocol developed by Verisign, Inc. for Cisco Systems, Inc. It now enjoys wide support in both client and CA implementations.
The goal of SCEP is to support the secure issuance of certificates to network devices in a scalable manner, using existing technology whenever possible. The protocol supports the following operations:
Certificate and CRL access can be achieved by using the LDAP protocol, or by using the query messages defined in SCEP.
Currently, SSCEP implements:
There's no LDAP support, and probably there will never be (that's why it is simple).
SSCEP has been tested successfully against the following CA products:
(*) by default, subjectAltName extensions are dropped from certificate
(**) only DNS subjectAltName allowed (demo mode)
(***) demo requires to use /C=US/O=Entrust
The program should compile on the following systems:
In general, two build systems are supported:
Prerequisites:
pkg-configlibcrypto libraryOn Ubuntu you may use:
sudo apt-get install autoconf automake libtool pkg-config libssl-devTo compile run:
$ make
To generate the configure script when checking out from github source:
$ ./bootstrap.shTo compile from a tarball created with 'make dist'
$ ./configure
$ make
$ make installTo build an RPM package from the tarball do
cp sscep-*.tar.gz ~/rpmbuild/SOURCES
rpmbuild -ba scripts/sscep.specDownload and install:
Start the CMake GUI, select Where is the source code and Where to put the binaries (it could be the same), then Configure and Generate the project files.
Start the Visual Studio, open the generated Solution (sscep.sln) and build the project. Then copy the sscep binary (Debug or Release) and configuration file sscep.conf somewhere.
Install a few packages from Homebrew:
$ brew install autoconf automake libtool pkg-config opensslTo generate the configure script when checking out from github source:
$ glibtoolize
$ aclocal
$ automake -a -c -f
$ autoreconfSet PKG_CONFIG_PATH and then the usual will work:
$ export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
$ ./configure
$ make
$ make installRunning the command "sscep" without any arguments should give you a list of arguments and command line options.
…SSCEP also supports configuration via a configuration file (-f).
This is the recommended way to configure SSCEP and all the examples
in below assume that you have done so.
All configuration options are key-value pairs separated with the equal sign and grouped into sections:
[section]
Key = ValueQuotation marks are optional - they are needed only if the value contains space characters (space or tab). Quotation marks inside the value string must be escaped using a backslash:
Key = "Value \"containing quotation marks\""Comment lines (lines starting with '#') and empty lines are discarded.
Here are the available configuration file keys and example values:
| Key | Explanation | Example | Command options |
|---|---|---|---|
| URL | URL of the SCEP server. | http://example.com/scep |
-u |
| CACertFile | Single CA certificate file, or multiple CA certificates suffixed with -0, -1, ... to write (getca) or to choose from (all other operations). |
./ca.crt |
-c |
| CAIdentifier | Some CAs require you to define this. | mydomain.com |
-i |
| CertReqFile | Certificate request file created with mkrequest. | ./local.csr |
-r |
| EncAlgorithm | PKCS#7 encryption algorithm. Available algorithms are des, 3des, blowfish, aes/aes128, aes192 and aes256. NOTE: SCEP provides no mechanism to "negotiate" the algorithm - even if you send 3des, reply might be des (same thing applies to SigAlgorithm). | -E |
|
| EncCertFile | If your CA/RA uses a different certificate for encyption and signing, define this. CACertFile is used for verifying the signature. | ./enc.crt |
-e |
| SignCertFile | Instead of creating a self-signed certificate from the new key pair use an already existing certficate/key to sign the SCEP request. If the "old" certificate and key is used, the CA can verify that the holder of the private key for an existing certificate re-enrolls for a renewal certificate, allowing for automatic approval of the request. Requires specification of the corresponding SignKeyFile (-K). |
./sig.crt |
-O |
| SignKeyFile | See SignCertFile. Specifies the corresponding private key. | ./sig.key |
-K |
| FingerPrint | Display fingerprint algorithm. Available algorithms are md5, sha1, sha224, sha256, sha384 and sha512. Default is the best from getcacaps, or md5. | -F |
|
| GetCertFile | Write certificate asquired via getcert operation. | ./cert.crt |
-w |
| GetCertSerial | Certificate serial number. Define this for getcert. The value is defined as a decimal number. | 12 |
-s |
| GetCrlFile | Write CRL to file. | ./crl.crl |
-w |
| LocalCertFile | Write successfully enrolled certificate. | ./local.crt |
-l |
| MaxPollCount | Max number of GetCertInitial requests. | 50 |
-n |
| MaxPollTime | Max polling time in seconds. | 28800 |
-T |
| PollInterval | Poll periodically for pending certificate. | 60 |
-t |
| PrivateKeyFile | Private key created with mkrequest. | ./local.key |
-k |
| Proxy | Use HTTP proxy at host:port. | localhost:8080 |
-p |
| SelfSignedFile | Write optionally the selfsigned certificate in file (needed in SCEP transaction). | ./selfsigned.crt |
-L |
| SigAlgorithm | PKCS#7 signature algorithm. Available algorithms are md5, sha1, sha224, sha256, sha384 and sha512. Default is the best from getcacaps, or md5. | -S |
|
| Verbose | Verbose output? Answer "yes" or "no" | -v |
|
| Debug | Debug output? Answer "yes" or "no". | -d |
The actual enrollment is done with the following procedure:
http://pkiserver.company.com/cgi-bin/pkiclient.exeBefore the enrollment can take place, sscep needs a private key file and the corresponding X.509 certificate request in PKCS#10 format.
This can be created using the mkrequest script, or manually by openssl. Create an request.cnf, such as:
…To create a key and a request named local.key and local.csr run:
$ openssl req -new -config request.cnf -out local.csrYou can automate this process using the mkrequest shell script. Edit the DN variables in the mkrequest file if you need. When ready, make the request:
$ mkrequest -ip 172.30.0.1
Generating RSA private key, 1024 bit long modulus
..............++++++
...++++++
e is 65537 (0x10001)
Using configuration from .4018client.cnfThis also writes key and request named local.key and local.csr (you can change the "local" with variable PREFIX in mkrequest).
If the CA supports automatic enrollment, you may supply the password in cert request:
$ mkrequest -ip 172.30.0.1 password$ ./sscep getca -u http://example.com/scep -c ca.crt
./sscep: requesting CA certificate
./sscep: valid response from server
./sscep: MD5 fingerprint: 1D:3C:4C:DF:99:73:B8:FB:B4:EE:C4:56:A9:7C:37:A3
./sscep: CA certificate written as ca.crtNOTE: it is very important to make sure that the CA certificate is really what you think it is. The security of the whole protocol depends on that!! This is why the fingerprint is printed on terminal - you should check that from your CA. You can check the fingerprint any time with command
$ openssl x509 -in ca.crt -noout -fingerprintIf the CA sends a certificate chain, sscep writes all certificates in the order it founds them in reply and names them with an integer suffix (-number) appended to CACertFile.
…SSCEP prints out issuer, subject, key usage and md5/sha1 fingerprint for
each certificate it founds. This information might help you to decide what
certificate to use as -c and (optionally) -e in subsequent operations.
Some CAs may give you a three (or more) certificates, the root CA(s) plus
different RA certificates for encryption and signing. If that's your case,
you have to define encryption certificate with command line option (-e).
Probably it is the certificate with key usage "Key Encipherment".
You may also use the base name (e.g., ca.crt) of all certificates and
rely on an automated certificate selection. The system loads all available
certificates (ca.crt-0, ca.crt-1, ...) and then:
-c) or "Key Encipherment"
(for -e), or does not have any key usage defined.Currently, SSCEP doesn't verify the CA/RA certificate chain. You can do it manually with OpenSSL:
$ openssl verify -CAfile ca.crt-1 ca.crt-0
ca.crt-0: OKNOTE: In case of multiple CA/RA certificates, the actual CA (the one who signs your certificate) might not be the same as the CA/RA you are dealing with. Keep this in mind when installing the CA cert in /etc/isakmpd/ca.
You need to supply URL (-u), CACertFile (-c), PrivateKeyFile (-k),
CertReqFile (-r) and output LocalCertFile (
暂无开放 Issues,或尚未同步最近议题。