Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There is no difference in using a Private CA or Public CA concerning functionality of X.509 certificates, usage for Signing, or security of certificates. The only difference is that users trust the Private CA that they set up on their own instead of trusting an external Public CA.

Self-issued Certificates and Private CA Certificates are deployed to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

The article explains how to create Signing Certificates for use with JS7. Users who operate an existing Private Certificate Authority might find different approaches and different responsibilities for the indicated steps. There's more than one way how to do it.

Examples in the article make use of JS7 Release 2.7.2, OpenSSL 1.1.1k  FIPS 25 Mar 2021 for Unix and OpenSSL 3.1.4 24 Oct 2023 for Windows. OpenSSL ships with Linux & other Unix OS and is available for Windows.

...

Code Block
languagebash
titleExample how to create Private Key and Certificate Signing Request using ECDSA encryption (Unix)
linenumberstrue
# Specify key name used for file names
key_name=signing

# Create Private Key
openssl ecparam -genkey -name secp384r1 -out ${key_name}.key

# Create Certificate Signing Request
 openssl req -new -sha512 -nodes \
    -key ${key_name}.key \
    -out ${key_name}.csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}"

...

Anchor
creating_certificates
creating_certificates
Creating CA-signed Certificates

...

Users chose this approach if they intend to authorize users to deploy scheduling objects based on Signing Certificates issued by a specific CA.

  • Any certificates signed by the CA will be accepted by Controllers and Agents to which the CA Certificate is deployed.
  • The approach makes sense if users are in control of certificates created by the CA. Benefits include that a single CA Certificate is deployed to Controller and Agents instead of individual certificate files from self-issued Certificates.

Anchor
creating_ca
creating_ca
Setting up the Private CA

For Private CA-signed Certificates a Certificate Authority (CA) is required owning a CA Private Key and CA Certificate. The CA Private Key and CA Certificate will be used to sign certificates on behalf of users.

  • Setup of the Certificate Authority is performed once.
  • Signing

For Private CA-signed Certificates a Certificate Authority (CA) is required owning a CA Private Key and CA Certificate. The CA Private Key and CA Certificate will be used to sign certificates on behalf of users.

  • Setup of the Certificate Authority is performed once.
  • Signing is performed for each certificate on behalf of users.

...

Code Block
languagebash
titleExample how to create Signing Certificate (Unix)
linenumberstrue
# Specify key name used for file names
key_name=signing

# Create Certificate
openssl x509 -req -sha512 -days 3652 \
    -CA signing-ca.crt \
    -CAkey signing-ca.key \
    -CAcreateserial \
    -in ${key_name}.csr \
    -out ${key_name}.crt \
    -extfile <(printf '\nkeyUsagekeyUsage=critical,nonRepudiation,digitalSignature\nextendedKeyUsage=critical,codeSigning\n')

...

Expand
titleExplanations...
  • Explanations are similar to Creating self-issued Certificates with a few exceptions:
    • The -days option specifying the validity period of the Signing Certificate should indicate a shorter period than the validity period of the CA Certificate.
    • The -CA option specifies the location of the CA Certificate file.
    • The -CAkey option specifies the location of the CA Private Key file.
    • The -in option specifies the location of the Certificate Signing Request.
    • The -extfile option specifies the Key Usage and Extended Key Usage being limited to code signing.
  • The following files will be created with this step:
    • The signing.crt file will hold the Signing Certificate.

The Signing Certificate file does not require to be deployed to Controller and Agent instances. Instead, the CA Certificate file is deployed to Controller and Agent instances.

...

  • with this step:
    • The signing.crt file will hold the Signing Certificate.

The Signing Certificate file does not require to be deployed to Controller and Agent instances. Instead, the CA Certificate file is deployed to Controller and Agent instances.

Resources

Shell Scripts

As an alternative to running OpenSSL commands in an interactive shell, scripts are provided that perform this task.

The below scripts assume the following directory layout:

  • <ca>  The directory <ca> is a placeholder. Any directory can be used.
    • create_root_ca.sh
    • create_signing_certificate.sh
    • certs
    • csr
    • private

The sub-directories certs, csr and private will be created should they not exist.

Creating the Private Root CA Certificate

Download: create_root_ca.sh

The following files will be created when executing the script:

  • <ca>/certs/root-ca.crt
  • <ca>/csr/root-ca.csr
  • <ca>/private/root-ca.key

This step is performed just once. In case of renewal of the Root CA Certificate any Server Certificates will have to be renewed.

Code Block
languagebash
titleRun .create_root_ca.sh shell script
linenumberstrue
# Description
# create_root_ca.sh --key-name=<basename> --subject=<distinguished-name> --days=<number-of-days>

# Example for use with defaults
./create_root_ca.sh

# Example for use with basename
./create_root_ca.sh --key-name=ca-root

# Example applying specific distinguished name and lifetime
./create_root_ca.sh --subject="/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=JS7 CA" --days=7660


The shell script is optionally executed with the following arguments:

  • --key-name
    • The basename of the key without extension. Default: root-ca
  • --subject
    • The distinguished name that is used as the subject of the CA Certificate. Default: /C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=Root CA
  • --days
    • The lifetime of the certificate is specified by the number of days. Default: 7305
    • Consider that Server Certificates have to be renewed if the Root CA Certificate expires.

Creating a Signing Certificate

Download: create_signing_certificate.sh

The following files will be created with <user> being a placeholder for the user for which a certificate should be created.

  • <ca>/certs/<user>.crt
  • <ca>/csr/<user>.csr
  • <ca>/private/<user>.key

This step is performed for each Signing Certificate that should be created.

Code Block
languagebash
titleRun .create_signing_certificate.sh shell script
linenumberstrue
# Description
# create_signing_certificate.sh --key-name=<basename> --ca-key-name=<basename> --subject=<distinguished-name> --days=<number-of-days>

# Example for use with key name and lifetime
./create_signing_certificate.sh --key-name=ap --days=365

# Example for use with key name, CA key name and lifetime
./create_signing_certificate.sh --key-name=ap --ca-key-name=signing-ca --days=4017

# Example for use with key name, subject and lifetime
./create_signing_certificate.sh --key-name=ap --subject="/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=ap" --days=4017
 


The shell script is executed with the following arguments:

  • --key-name (required)
    • The basename of the key without extension. 
  • --ca-key-name
    • The basename of the CA key without extension. Default: root-ca
  • --subject
    • The distinguished name that is used as the subject of the Signing Certificate. Default: /C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=<key-name>
    • The CN attribute should specify the user name. By default the key name specified with the --key-name option is used.
  • --days
    • The lifetime of the certificate is specified by the number of days. Default: 3652