Generating a Certificate Signing Request, suitable for use with CoSign on Windows

CoSign uses SSL to ensure the integrity of authentication requests between the cosign server and the application server.

The following instructions cover generation of a Certificate Signing Request (CSR) on a Windows server.

If you want to learn how to install and configure CoSign, you should read the instructions on installing CoSign:

Generating the CSR (for IIS6 and IIS7)

Notation

In these instructions the following notation is used:

Create a file called "luconfig.cfg" in your "C:\Program Files\IISCosign" folder. The contents of this file are given below. Amend this file to include your web server name and contact email.

[ req ]
default_bits       = 2048
default_keyfile    = privkey.pem
distinguished_name = req_distinguished_name
attributes         = req_attributes
x509_extensions    = v3_ca

dirstring_type = nobmp

[ req_distinguished_name ]
countryName                     = Country Name (2 letter code)
countryName_value               = GB

stateOrProvinceName             = State or Province name (full name)
stateOrProvinceName_value       = Lancashire

localityName                    = Locality name (e.g., city)
localityName_value              = Lancaster

organizationName                = Organization Name (e.g., company)
organizationName_value          = Lancaster University

organizationalUnitName          = Organization Unit Name (e.g., ITCS, LSA)
organizationalUnitName_value    = Information Systems Services

commonName                      = cp (e.g., web server\'s hostname)
commonName_value                = domainname.lancs.ac.uk

emailAddress                    = contact e-mail for cert:
emailAddress_value              = contact@lancaster.ac.uk

[req_attributes]

[ v3_ca ]

subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:true

Open a command prompt and cd to your "C:\Program Files\IISCosign" folder. Run the following commands:

openssl genrsa 2048 > domainname.key

openssl req -new -config luconfig.cfg
    -key domainname.key
    -out domainname.csr

Send an e-mail to Steve Bennett, attaching the domainname.csr file.

In reply, you should receive the following files:

Place these files in the "C:\Program Files\IISCosign\SSL" sub-folder.

Take the 'cert' part of the domainname-cert.pem file and put it into a new file called domainname.cert. The cert part is the data between and including the lines:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
Be sure the line with BEGIN CERTIFICATE is the very first line of the domainname.cert file and there should be no extra lines or line breaks after the END CERTIFICATE

Copy the domainname.cert file into the "C:\Program Files\IISCosign\SSL" sub-folder.

For Windows Server2008/IIS7 only

If you are deploying the Cosign Module on Windows Server 2008/IIS7 you will need to complete all the steps above before attempting the steps below. These are required because the Cosign Module retrieves the certificate from the Windows certificate store.

Open a command prompt and cd to your "C:\Program Files\IISCosign" folder. Run the following commands. You will be prompted for a password. Remember this password! You will need it later.

openssl pkcs12
    -in domainname.cert
    -inkey domainname.key
    -export -out domainname.p12

On the server complete the following instructions (during installation only).

On the server complete the following instructions:

Firstly, cosign needs a certificate authority file to verify the identity of the weblogin server it is talking to. This stage only needs to be done during installation.

Next, import the Personal Information Exchange File (domainname.p12). This must be done every year before the certificate expires.