Versions Compared

Key

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

...

JS7 - Deployment of Scheduling Objects makes use of Signing Certificates to digitally sign workflows and other objects. Signing Certificates are deployed to Controllers and Agents. Use of certificates for signing is not related to use of certificates to secure connections using HTTPS.

...

HTTPS connections, see JS7 - How to create X.509 SSL TLS Certificates.

Users

...

  • Creating self-signed Certificates.
  • Creating Private CA-signed Certificates.
  • Buy Public CA-signed Certificates

can choose one of the approachs specified with RFC5280:

  • Self-issued Certificates are created individually per user and are deployed from individual certificate files to Controllers and Agents.
    • There

Rollout of certificates to Controllers and Agents depends on the following choice:

  • Self-signed Certificates have to be deployed from individual certificate files made available to Controllers and Agents.
    • There is no security gap in use of self-signed issued Certificates. When users store certificate files to Controllers and Agents then this proves that they trust the certificates.
  • Private CA-signed Certificates are not deployed to Controllers and Agents. Insteadissued by users who operate their own Private Certificate Authority (CA). Individual Signing Certficates on behalf of users are not deployed to Controllers and Agents. Instead, the CA Certificate is deployed that was used to sign individual certificatesSigning Certificates.
    • The approach includes that any signing certificate Signing Certificate signed by the CA will be accepted for deployment of scheduling objects.
    • For better control which certificates are made available for deplyoment, users might decide to use a specific Intermediate Private CA.
  • Public CA-signed Certificates are issued by a trusted Certificate Authority (CA) that validates the domain owner. Such certificates are not created by users but are purchased from a the trusted CA and therefore are not considered by the in scope of this article.

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 Self-signed Certificates and Private CA Certificates are deployed to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

The article suggests the following steps for creation of both Self-signed Certificates and Private CA-signed Certificates:

  • Create Private Key
  • Create Certificate Signing Request (CSR)
  • Create and sign Certificate

The article explains how to create Signing Certificates for use with JS7. Users who operate their 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 and JS7 Release 2.7.2for Unix and OpenSSL 3.1.4 24 Oct 2023 for Windows. OpenSSL ships with Linux & other Unix OS and is available for Windows. The examples are focused on Unix.

Anchor
creating_

...

self_

...

issued_

...

certificates
creating_

...

self_

...

issued_

...

certificates
Creating self-issued Certificates

Users chose this approach if they intend to authorize specific users to deploy scheduling objects:

  • The approach is managable if the number of Controller and Agent instances that receive the certificate is within acceptable limits.
    • Consider certificate renewal that includes to update the certificate file on related Controller and Agent instances.
    • Consider certificate revocation that includes to remove the certificate file from related Controller and Agent instances.
  • The approach allows fine-grained control, but comes at a price of having to manage deployment of user certificates individually.

Anchor
creating_private_key_and_csr
creating_private_key_and_csr
Creating the Private Key and Certificate Signing Request

The steps to create a Private Key and Certificate Signing Request are similar for self-issued Certificates and Private CA-signed Certificates.

Users have the option to use ECDSA or RSA algorithms for encryption performed using the Private Key.

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files.

Anchor
using_private_key_ecdsa
using_private_key_ecdsa
Using ECDSA Encryption

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 

The steps to create a Private Key and Certificate Signing Request are the same for use of self-signed Certificates and Private CA-signed Certificates. Users have the option to use ECDSA or RSA for the encryption type applied to the Private Key.

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files.

...

Code Block
languagebash
titleExample how to create Private Key and Certificate Signing Request using ECDSA encryption
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 (CSR)
openssl req -new -sha512 -nodes \
    -key ${key_name}.key \
    -outkey ${key_name}.csrkey \
    -subj "/C=out ${key_name}.csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}"

...

Expand
  • Private Key
    • Choice of algorithm such as secp256k1, secp384r1 depends on support by the Java version used with JS7.
  • Certificare Signing Request
    • The hash algorithm such as -sha256, -sha512 can be freely chosen.
    • The -subj option specifies the Distinguished Name used for the subject of the CSR and resulting Certificate.
      • The Distinguished Name is a unique identifier frequently using the hierarchy of Country C, State ST, Location L, Organization O, Organizational Unit OU and Common Name CN.
      • For self-signed Certificates the subject and issuer properties of the CSR/Certificate are the same. The minimum requirement is to specify the Common Name CN=<name> where <name> can freely be chosen.
      • For Private CA-signed Certificates the subject property holds the Certificate's Distinguished Name and the issuer property holds the Private CA Certificate's Distinguished Name using different values.
  • The following files will be created with this step:
    • The <key_name>.key file will hold the Private Key.
    • The <key_name>.csr file will hold the Certificate Signing Request.

...

titleWindows version...
Code Block
languagetext
titleExample how to create Private Key and Certificate Signing Request using ECDSA encryption (Windows)
linenumberstrue
@rem Specify key name used for file names
set key_name=signing
 
@rem Create Private Key
openssl ecparam -genkey -name secp384r1 -out %key_name%.key
 
@rem 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%"
Expand
titleExplanations...
  • Private Key
    • Choice of algorithm such as secp256k1, secp384r1 depends on support by the Java version used with JS7.
  • Certificare Signing Request
    • The hash algorithm such as -sha256, -sha512 can be freely chosen.
    • The -subj option specifies the Distinguished Name used for the subject of the CSR and resulting Certificate.
      • The Distinguished Name is a unique identifier frequently using the hierarchy of Country C, State ST, Location L, Organization O, Organizational Unit OU and Common Name CN.
      • For self-issued Certificates the subject and issuer properties of the CSR/Certificate are the same. The minimum requirement is to specify the Common Name CN=<name> where <name> can freely be chosen.
      • For Private CA-signed Certificates the subject property holds the certificate's Distinguished Name and the issuer property holds the Private CA Certificate's Distinguished Name that must be different.
  • The following files will be created with this step:
    • The signing.key file will hold the Private Key.
    • The signing.csr file will hold the Certificate Signing Request.

Anchor
using_private_key_rsa
using_private_key_rsa
Using RSA Encryption

Expand
titleClick to expand/collapse...
Code Block
languagebash
titleExample how to create Private Key and Certificate Signing Request using RSA encryption (Unix)
linenumberstrue
# Specify key name used for file names
key_name=signing

# Create Private Key and Certificate Signing Request
openssl req -new -newkey rsa:4096 -sha256 -nodes \
    -keyout ${key_name}.key \
    -out ${key_name}.csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}"
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create Private Key and Certificate Signing Request using RSA encryption (Windows)
linenumberstrue
@rem Specify key name used for file names
set key_name=signing
 
@rem Create Private Key and Certificate Signing Request
openssl req -new -newkey rsa:4096 -sha256 -nodes ^
    -keyout %key_name%.key ^
    -out %key_name%.csr ^
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=%key_name%"
Expand
titleExplanations...
  • In the example the Private Key is created using the specified key size 4096.
  • For use of the SHA hash algorithm -sha256 and the -subj option see Using ECDSA Encryption.
  • The following files will be created with this step:
    • The signing.key file will hold the Private Key.
    • The signing.csr file will hold the Certificate Signing Request.

Anchor
creating_self_signed_certificates
creating_self_signed_certificates
Creating the Signing Certificate

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files.

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

# Create Certificate
openssl x509 -req -sha512 -days 3652 \
    -signkey ${key_name}.key \
    -in ${key_name}.csr \
    -out ${key_name}.crt \
    -extfile <(printf "keyUsage=critical,nonRepudiation,digitalSignature\nextendedKeyUsage=critical,codeSigning\n")
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create self-issued Certificate (Windows)
linenumberstrue
@rem Specify key name used for file names
set key_name=signing
 
@rem Create Certificate
set user_crt_tmp_file=user-crt-%RANDOM%.tmp
copy /Y NUL %user_crt_tmp_file%
echo keyUsage=critical,nonRepudiation,digitalSignature >> %user_crt_tmp_file%
echo extendedKeyUsage=critical,codeSigning >> %user_crt_tmp_file%

openssl x509 -req -sha512 -days 3652 ^
    -signkey %key_name%.key ^
    -in %key_name%.csr ^
    -out %key_name%.crt ^
    -extfile %user_crt_tmp_file%

del /q %user_crt_tmp_file%
Expand
titleExplanations...
  • The SHA option such as -sha256, -sha384, -sha512 can be freely chosen.
  • The -days argument optionally specifies the validity period of the resulting certificate.
  • The -signkey option specifies the location of the Private Key file created from the previous step.
  • The -in option specifies the location of the Certificate Signing Request file created from the previous step.
  • The -out option specifies the location of the resulting Certificate file.
  • The -extfile option specifies a number of extensions recommended for use with Signing Certificates. 
  • The following files will be created with this step:
    • The signing.crt file will hold the self-issued Certificate.

Self-issued Certificates must be copied to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

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 is performed for each certificate on behalf of users.

The steps to create the CA Private Key and CA Certificate are similar to Creating the Private Key and Certificate Signing Request for self-issued Certificates.

Anchor
creating_ca_private_key
creating_ca_private_key
Creating the Private Key and Certificate Signing Request

Steps include to create the signing-ca.key CA Private Key file and signing-ca.csr CA Certificate Signing Request file both in PEM format.

Users have the option to use ECDSA or RSA algorithms for encryption performed using the Private Key.

Users can run the following commands from the shell and replace the value of the ca_key_name environment variable with a name of their choice that is used when creating related files.

Anchor
using_private_key_ecdsa
using_private_key_ecdsa
Using ECDSA Encryption

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
ca_key_name=signing-ca

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

# Create Certificate Signing Request
openssl req -new -sha512 -nodes \
    -key ${ca_key_name}.key \
    -out ${ca_key_name}.csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${ca_key_name}"
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create Private Key and Certificate Signing Request using ECDSA encryption (Windows)
linenumberstrue
@rem Specify key name used for file names
set ca_key_name=signing-ca
 
@rem Create Private Key
openssl ecparam -genkey -name secp384r1 -out %ca_key_name%.key
 
@rem Create Certificate Signing Request
openssl req -new -sha512 -nodes ^
    -key %ca_key_name%.key ^
    -out %ca_key_name%.csr ^
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=%ca_key_name%"
Expand
titleExplanations...

Anchor
using_ca_private_key_rsa
using_ca_private_key_rsa
Using RSA Encryption

Expand
titleClick to expand/collapse...
Code Block
languagebash
titleExample how to create Private Key and Certificate Signing Request using RSA encryption (Unix)
linenumberstrue
# Specify key name used for file names
ca_key_name=signing-ca

# Create Private Key and Certificate Signing Request
openssl req -new -newkey rsa:4096 -sha256 -nodes \
    -keyout ${ca_key_name}.key \
    -out ${ca_key_name}.csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${ca_key_name}"
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create Private Key and Certificate Signing Request using RSA encryption (Windows)
linenumberstrue
@rem Specify key name used for file names
set ca_key_name=signing-ca
 
@rem Create Private Key and Certificate Signing Request
openssl req -new -newkey rsa:4096 -sha256 -nodes ^
    -keyout %ca_key_name%.key ^
    -out %ca_key_name%.csr ^
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=%ca_key_name%"
Expand
titleExplanations...

Anchor
creating_ca_certificate
creating_ca_certificate
Creating the CA Certificate

Steps include to create the signing-ca.crt Private CA-signed Certificate file in PEM format.

Users can run the following commands from the shell and replace the value of the ca_key_name environment variable with a name of their choice that is used when creating related files.

Code Block
languagebash
titleExample how to create CA Certificate (Unix)
linenumberstrue
# Specify key name used for file names
ca_key_name=signing-ca

# Create Certificate
openssl x509 -req -sha512 -days 7305 \
    -signkey ${ca_key_name}.key \
    -in ${ca_key_name}.csr \
    -out ${ca_key_name}.crt \
    -extfile <(printf "basicConstraints=CA:TRUE\nkeyUsage=critical,nonRepudiation,keyCertSign,cRLSign\n")
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create CA Certificate (Windows)
linenumberstrue
@rem Specify key name used for file names
set ca_key_name=signing-ca
 
@rem Create Certificate
set ca_crt_tmp_file=ca-crt-%RANDOM%.tmp
copy /Y NUL %ca_crt_tmp_file%
echo basicConstraints=CA:TRUE >> %ca_crt_tmp_file%
echo keyUsage=critical,nonRepudiation,keyCertSign,cRLSign >> %ca_crt_tmp_file%

openssl x509 -req -sha512 -days 7305 ^
    -key %ca_key_name%.key ^
    -in %ca_key_name%.csr ^
    -out %ca_key_name%.crt ^
    -extfile %ca_crt_tmp_file%

del /q %ca_crt_tmp_file%
Expand
titleExplanations...
  • Explanations are similar to Creating self-issued Certificates with a few exceptions.
    • The -days option specifying the validity period of the CA Certificate should be longer than the validity period of individual certificates.
    • The -extfile option specifies the Basic Constraint CA:TRUE which is required for a CA Certificate. Key Usage is limited to Signing Certificates.
  • The following files will be created with this step:
    • The signing-ca.crt file will hold the CA Certificate.

The CA Certificate must be copied to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

Anchor
creating_signing_certificates
creating_signing_certificates
Creating Signing Certificates

The steps explained with this section are performed for each Signing Certificate created on behalf of a user.

Anchor
creating_signing_private_key
creating_signing_private_key
Creating the Private Key and Certificate Signing Request

Steps include to create the signing.key Private Key file and signing.csr Certificate Signing Request file both in PEM format.

Users have the option to use ECDSA or RSA algorithms for encryption performed using the Private Key.

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files.

Anchor
using_private_key_ecdsa
using_private_key_ecdsa
Using ECDSA Encryption

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}"
Expand
titleWindows version...
Code Block
languagetext

...

bash RSA
Code Block
language
titleExample how to create Private Key and Certificate Signing Request using
ECDSA encryption (Windows)
linenumberstrue
#
@rem Specify key name used for file names
set key_name
=signing # Create Private Key and
=signing-ca
 
@rem Create Private Key
openssl ecparam -genkey -name secp384r1 -out %key_name%.key
 
@rem Create Certificate Signing Request
(CSR)

openssl req -new -
newkey
sha512 
rsa:4096
-
sha256 -
nodes 
\
^
    
-
keyout
key 
${key_name}
%key_name%.key 
\
^
  
  -out 
${key_name}
%key_name%.csr 
\
^
    
-subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=
${key_name}"

Explanation:

...

%key_name%"
Expand
titleExplanations...

...

  • .
  • The following files will be created with this step:
    • The

...

    • signing.key file will hold the Private Key.
    • The

...

    • signing.csr file will hold the Certificate Signing Request.

Anchor

...

using_

...

Users have the option to create self-signed Certificates or Private CA-signed Certificates.

...

private_key_rsa
using_private_key_rsa
Using RSA Encryption

Expand
titleClick to expand/collapse..

...

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

# Create Private Key and Certificate Signing Request
openssl 
x509
req -
req
new -
sha512
newkey rsa:4096 -
days
sha256 
3652
-nodes \
    -
signkey
keyout ${key_name}.key \
    -
in
out ${key_name}.csr \
    -
out
subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}
.crt \ -extfile <(printf "keyUsage=critical,nonRepudiation,digitalSignature\nextendedKeyUsage=critical,codeSigning\n")

Explanation:

  • The SHA option such as -sha256, -sha384, -sha512 can be freely chosen.
  • The -days argument optionally specifies the validity period of the resulting certificate.
  • The -signkey option specifies the location of the Private Key file created from the previous step.
  • The -in option specifies the location of the Certificate Signing Request file created from the previous step.
  • The -out option specifies the location of the resulting Certificate file.
  • The -extfile option specifies a number of extensions recommended for use with Signing Certificates. 
  • The following files will be created with this step:
    • The <key_name>.crt file will hold the self-signed Certificate.

Self-signed Certificates must be copied to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

...

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.

...

The steps to create the CA Private Key and CA Certificate are similar to Creating the Private Key and Certificate Signing Request for self-signed Certificates.

...

"
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create Private Key and Certificate Signing Request using RSA encryption (Windows)
linenumberstrue
@rem Specify key name used for file names
set key_name=signing
 
@rem Create Private Key and Certificate Signing Request
openssl req -new -newkey rsa:4096 -sha256 -nodes ^
    -keyout %key_name%.key ^
    -out %key_name%.csr ^
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=%key_name%"
Expand
titleExplanations...
  • In the example the Private Key is created using the specified key size 4096.
  • For use of the SHA hash algorithm -sha256 and the -subj option see Using ECDSA Encryption.
  • The following files will be created with this step:
    • The signing.key file will hold the Private Key.
    • The signing.csr file will hold the Certificate Signing Request.

Anchor
creating_signing_certificate
creating_signing_certificate
Creating the Signing Certificate

Steps include to create the signing-ca.key CA Private Key file and signing-ca.csr CA Certificate Signing Request file both crt Private CA-signed Certificate file in PEM format.

Users can run the following commands from the shell and replace the value of the ca_key_name environment variable with a name of their choice that is used when creating related files.:

Code Block
languagebash
titleExample how to create CA Private Key and Certificate Signing RequestSigning Certificate (Unix)
linenumberstrue
# Specify key name used for file names
ca_key_name=signing-ca

# Create Private KeyCertificate
openssl ecparamx509 -req -genkeysha512 -name secp384r1days 3652 \
    -outCA ${ca_key_name}.key

# Create Certificate Signing Request (CSR)
openssl req -new -sha512 -nodessigning-ca.crt \
    -CAkey signing-ca.key \
    -CAcreateserial \
    -keyin ${ca_key_name}.keycsr \
      -out ${ca_key_name}.csrcrt \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${ca_key_name}"

Explanation:

...

extfile <(printf 'keyUsage=critical,nonRepudiation,digitalSignature\nextendedKeyUsage=critical,codeSigning\n')
Expand
titleWindows version...
Code Block
languagetext
titleExample how to create Signing Certificate (Windows)
linenumberstrue
@rem Specify key name used for file names
set key_name=signing
 
@rem Create Certificate
set user_crt_tmp_file=user-crt-%RANDOM%.tmp
copy /Y NUL %user_crt_tmp_file%
echo basicConstraints=CA:TRUE >> %user_crt_tmp_file%
echo keyUsage=critical,nonRepudiation,digitalSignature >> %user_crt_tmp_file%
echo extendedKeyUsage=critical,codeSigning >> %user_crt_tmp_file%

...

Steps include to create the signing-ca.crt Private CA-signed Certificate file in PEM format.

Users can run the following commands from the shell and replace the value of the ca_key_name environment variable with a name of their choice that is used when creating related files.

Code Block
languagebash
titleExample how to create CA Certificate
linenumberstrue
# Specify key name used for file names ca_key_name=signing-ca # Create Certificate
openssl x509 -req -sha512 -days
7305 \
 3652 ^
    -CA signing-ca.crt ^
    -
signkey
CAkey 
${ca_key_name}.key \
signing-ca.key ^
    -CAcreateserial ^
    -in 
${ca_key_name}
%key_name%.csr 
\
^
    -out 
${ca_key_name}
%key_name%.crt 
\
^
    -extfile 
<(printf "basicConstraints=CA:TRUE\nkeyUsage=critical,nonRepudiation,keyCertSign,cRLSign\n")

...

%user_crt_tmp_file%

del /q %user_crt_tmp_file%
Expand
titleExplanations...

...

  • 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

...

  • The signing-ca.crt file will hold the CA Certificate.
    • 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.

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

The CA Certificate must be copied to the <data>/config/private/trusted-x509-keys directory of Controller and Agent instances.

...

Steps include to create the signing.key Private Key file and signing.csr Certificate Signing Request file both in PEM format.

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files.

Code Block
languagebash
titleExample how to create Signing Private Key and Certificate Signing RequestRun .create_root_ca.sh shell script
linenumberstrue
# Specify key name used for file names
key_name=signing Description
# create_root_ca.sh --key-name=<basename> --subject=<distinguished-name> --days=<number-of-days>

# Example for use with defaults
./create_root_ca.sh

# CreateExample Privatefor Key
openssluse ecparam -genkey -name secp384r1 -out ${key_name}.key

# Create Certificate Signing Request (CSR)
openssl req -new -sha512 -nodes \
    -key ${key_name}.key \
    -out ${key_name}.csr \
    -subj "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.

Explanation:

...

Steps include to create the signing.crt Private CA-signed Certificate file in PEM format.

Users can run the following commands from the shell and replace the value of the key_name environment variable with a name of their choice that is used when creating related files:

Code Block
languagebash
titleExample how to create Signing Certificate
linenumberstrue
Run .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# Specify key name used for file names
key_name=signing

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

Explanation:

  • Explanations are similar to Creating self-signed 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 -in option specifies the location of the Certificate Signing Request.
    • The -CA option specifies the location of the CA Certificate file.
    • The -CAkey option specifies the location of the CA Private Key file.
    • The -extfile option specifies the 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..

...

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