Versions Compared

Key

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

...

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 and
openssl ecparam -genkey -name secp384r1 -out "${key_name}".key

# Create Certificate Signing Request (CSR)
openssl req -new -newkey ecsha512 -pkeyopt ec_paramgen_curve:secp256k1 -sha256 -nodes \
    -keyoutkey "${key_name}".key \
    -out "${key_name}".csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}"

oder:

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

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

Explanation:

Explanation:

  • Choice of algorithm such as secp256k1, secp384r1 is up to the user.
  • The SHA option such as -sha256, -sha384 must match the algorithm.
  • The -subj option specifies the Distinguished Name used for the subject of the CSR and 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
  • Choice of algorithm such as secp256k1, secp384r1 is up to the user.
  • The SHA option such as -sha256, -sha384 must match the algorithm.
  • The -subj option specifies the Distinguished Name used for the subject of the CSR and 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 CA-signed Certificates the subject property holds the Certificate's Distinguished Name and the issuer property holds the CA Certificate's Distinguished Name. Both Distinguished Names should match except for the Common Name CN.
  • 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.

...

  • In the example the Private Key is created using the specified key size 4096.
  • The SHA option such as -sha256, -sha384, -sha512 must match the algorithm.
  • For use of the -subj option see Using ECDSA Encryption.
  • 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.

...

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

# Create Certificate
openssl x509 -req -sha384sha256 -days 3652 \
    -signkey "${key_name}".key \
    -in "${key_name}".csr \
    -out "${key_name}".crt \
    -extfile <(printf "keyUsage=critical,nonRepudiation,digitalSignature\nextendedKeyUsage=critical,codeSigning\n")

Explanation:

  • The SHA option such as -sha256, -sha384 must match the value of the option used when creating the Private Key/Certificate Signing Request.
  • The -days argument optionally specifies the validity period of the 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 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.

...

)

Explanation:

  • The SHA option such as -sha256, -sha384, -sha512 must match the value of the option used when creating the Private Key/Certificate Signing Request.
  • The -days argument optionally specifies the validity period of the 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.

Anchor
ca_signed_certificates
ca_signed_certificates
Creating CA-signed Certificates

For 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.

Anchor
creating_ca
creating_ca
Creating the Certificate Authority (CA)

The steps to create the CA Private Key and CA Certificate are similar to Creating the Private Key and Certificate Signing Request.

Anchor
creating_ca_private_key
creating_ca_private_key
Creating the CA 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 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 Request
linenumberstrue
# Specify key name used for file names
ca_key_name=signing-ca

# Create Private Key and Certificate Signing Request (CSR)
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:secp256k1 -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}"

oder:

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

# Create

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 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 Request
linenumberstrue
# Specify key name used for file names
ca_key_name=signing-ca

# Create Private Key and Certificate Signing Request (CSR)
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:secp256k1sha512 -sha256 -nodes \
    -keyoutkey "${ca_key_name}".key \
    -out "${ca_key_name}".csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${ca_key_name}"

...

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

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

# Create Certificate Signing Request (CSR)
openssl req -new -newkeysha512 ec -pkeyopt ec_paramgen_curve:secp256k1 -sha256 -nodes \
    -keyoutkey "${key_name}".key \
    -out "${key_name}".csr \
    -subj "/C=DE/ST=Berlin/L=Berlin/O=SOS/OU=IT/CN=${key_name}"

...

Code Block
languagebash
titleExample how to create Signing Certificate
linenumberstrue
# 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')

...