Cryptography Tutorials - Herong's Tutorial Examples - v5.42, by Herong Yang
"OpenSSL" Managing Serial Numbers when Signing CSR
This section provides a tutorial example on how to manage serial number when using 'OpenSSL' to sign a CSR (Certificate Signing Request) generated by 'keytool' with CA's private key.
If I use the "openssl x509 -req" command without providing serial number options, "OpenSSL" will give me an error like this:
herong> openssl x509 -req -in maria.csr -CA herong.crt -CAkey herong.key -out maria.crt -days 365 Loading 'screen' into random state - done Signature ok subject=/C=AT/ST=Maria State/L=Maria City/O=Maria Company /OU=Maria Unit/CN=Maria Teresa Getting CA Private Key Enter pass phrase for herong.key: keypass herong.srl: No such file or directory 2744:error:02001002:system library:fopen:No such file or directory: bss_file.c:276:fopen('herong.srl','rb') 2744:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:278:
"OpenSSL" will try to open a file named "herong.srl". The error message is not clear at all. It does not say that "herong.srl" is the serial number file. There are 3 ways to supply a serial number to the "openssl x509 -req" command:
Table of Contents
Introduction to AES (Advanced Encryption Standard)
DES Algorithm - Illustrated with Java Programs
DES Algorithm Java Implementation
DES Algorithm - Java Implementation in JDK JCE
DES Encryption Operation Modes
PHP Implementation of DES - mcrypt
Blowfish - 8-Byte Block Cipher
Secret Key Generation and Management
Cipher - Secret Key Encryption and Decryption
RSA Implementation using java.math.BigInteger Class
Introduction of DSA (Digital Signature Algorithm)
Java Default Implementation of DSA
Private key and Public Key Pair Generation
PKCS#8/X.509 Private/Public Encoding Standards
Cipher - Public Key Encryption and Decryption
OpenSSL Introduction and Installation
OpenSSL Generating and Managing RSA Keys
OpenSSL Generating and Signing CSR
OpenSSL Validating Certificate Path
"keytool" and "keystore" from JDK
►"OpenSSL" Signing CSR Generated by "keytool"
"OpenSSL" Acting as a CA (Certificate Authority)
"OpenSSL" Generating CA's Private Key
"OpenSSL" Self-Signing CA's Public Key
"keytool" Generating Maria's Private Key
"keytool" Generating Maria's CSR
►"OpenSSL" Managing Serial Numbers when Signing CSR
"keytool" Importing CA's Own Certificate
""keytool" Importing Maria's Certificate Signed by CA
Migrating Keys from "keystore" to "OpenSSL" Key Files
Certificate X.509 Standard and DER/PEM Formats
Migrating Keys from "OpenSSL" Key Files to "keystore"