zvrba/ software/ pgp x509

A small python script which generates a PKCS#10 certificate signing request from an existing PGP/GPG keypair. An example usage:

./genX509csr ~/.gnupg/pubring.gpg ~/.gnupg/secring.gpg zvrba

The first argument is public key ring, second is secret key ring and the third is an e-mail identifier (keys are sought for by email address). Then the program asks for the secret key password and the following X.509 attributes: country, commonName, organizationalUnit and organization. PKCS#10 CSR in PEM format is output to stdout.

Since the source is in Python, other attributes that should be included in a CSR are easily added.

This script depends on cryptlib and compiled and installed cryptlib_py python extension (also shipped with cryptlib).

python source (genX509csr)