Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sscep

> 编程语言
Open source

SSCEP is a command line client for the SCEP protocol

198 stars0 likes1 views
WebsiteGitHub

About

SSCEP is a command line client for the SCEP protocol

SSCEP - Simple SCEP client for Unix

Copyright (c) Jarkko Turkulainen 2003. All rights reserved.

See the file COPYING for licensing information.

WHAT IS SSCEP?

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.

WHAT SCEP?

(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:

  • CA and RA public key distribution
  • Certificate enrollment
  • Certificate and CRL query

Certificate and CRL access can be achieved by using the LDAP protocol, or by using the query messages defined in SCEP.

SSCEP FEATURES

Currently, SSCEP implements:

  • All of the SCEP operations using SCEP query messages
  • HTTP/1.1 queries via IPv4 or IPv6
  • Integration with OpenSSL cryptographic engines

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:

  • OpenXPKI (getcaps, getca, enroll and automatic approval works)
  • OpenSCEP server (getca, enroll and getcrl works)*
  • Windows2000 server CA + Microsoft SCEP module (works)
  • SSH Certifier (getca and enroll works)
  • iPlanet CMS (getca and enroll works)*
  • VeriSign Onsite (getca and enroll works)**
  • Entrust VPN Connect (getca and enroll works)***
  • OpenCA (getca, enroll, getcrl and automatic approval works)

(*) by default, subjectAltName extensions are dropped from certificate

(**) only DNS subjectAltName allowed (demo mode)

(***) demo requires to use /C=US/O=Entrust

HOW TO COMPILE

The program should compile on the following systems:

  • Linux
  • OpenBSD
  • AIX
  • Darwin (PowerPC, no universal binaries yet)
  • Tandem NonStop (Guardian), OSS environment, MIPS processor
  • z/OS (USS environment)
  • Solaris
  • Windows

In general, two build systems are supported:

  • GNU Autotools (autoconf, automake, libtool)
  • CMake

Prerequisites:

  • pkg-config
  • OpenSSL libcrypto library
    • sscep 0.3.0 - 0.6.1 works with openssl 0.9.7 - 1.0.2
    • sscep 0.7.0 - 0.9.1 works with openssl 0.9.7 - 1.1.1
    • sscep 0.10.0 works with openssl 1.1.0 - 3.0.0

On Ubuntu you may use:

bash
sudo apt-get install autoconf automake libtool pkg-config libssl-dev

Unix:

To compile run: $ make

To generate the configure script when checking out from github source:

cmd
$ ./bootstrap.sh

To compile from a tarball created with 'make dist'

cmd
$ ./configure
$ make
$ make install

To build an RPM package from the tarball do

cmd
cp sscep-*.tar.gz ~/rpmbuild/SOURCES
rpmbuild -ba scripts/sscep.spec

Windows:

  1. Download and install:

    • Microsoft Visual Studio (e.g. the Community Edition) from https://visualstudio.microsoft.com/downloads
    • CMake from https://cmake.org/download
    • Win32/Win64 OpenSSL from http://slproweb.com/products/Win32OpenSSL.html
  2. 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.

  3. 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.

macOS:

Install a few packages from Homebrew:

cmd
$ brew install autoconf automake libtool pkg-config openssl

To generate the configure script when checking out from github source:

cmd
$ glibtoolize
$ aclocal
$ automake -a -c -f
$ autoreconf

Set PKG_CONFIG_PATH and then the usual will work:

cmd
$ export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
$ ./configure
$ make
$ make install

HOW TO USE

Running 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 = Value

Quotation 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:

STEP 1 - Gather information

  • CA server identification string If your SCEP server requires you to use a specific identification string in the initial CA certificate access (step 3), write it down.
  • CA server http URL You must know the complete url, with http:// and cgi-program path and everything. Example: http://pkiserver.company.com/cgi-bin/pkiclient.exe
  • CA naming policy You need to know what kind of DN you request. Some may require you to use unstructuredName naming, some may require a CN with localityName, etc.

STEP 2 - Make certificate request and key

Before 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:

bash
$ openssl req -new -config request.cnf -out local.csr

You 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:

bash
$ mkrequest -ip 172.30.0.1
Generating RSA private key, 1024 bit long modulus
..............++++++
...++++++
e is 65537 (0x10001)
Using configuration from .4018client.cnf

This 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:

bash
$ mkrequest -ip 172.30.0.1 password

STEP 3 - Get CA certificate

bash
$ ./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.crt

NOTE: 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

bash
$ openssl x509 -in ca.crt -noout -fingerprint

If 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:

  1. Tries to find a certificate that:
    • Is at the end of the received chain, i.e., do not sign other certificate.
    • Has key usage "Digital Signature" (for -c) or "Key Encipherment" (for -e), or does not have any key usage defined.
  2. If no such key is found, selects the first certificate in the chain, which is usually the right certificate anyway.

Currently, SSCEP doesn't verify the CA/RA certificate chain. You can do it manually with OpenSSL:

bash
$ openssl verify -CAfile ca.crt-1 ca.crt-0
ca.crt-0: OK

NOTE: 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.

STEP 4 - Make enrollment

You need to supply URL (-u), CACertFile (-c), PrivateKeyFile (-k), CertReqFile (-r) and output LocalCertFile (

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言