E.1 Creating a private key
The following describes the command provided by JP1/AJS3 - Web Console to create a private key.
- Format
-
To create an RSA certificate:
- In Windows:
openssl.bat genrsa -rand name-of-the-file-to-be-used-for-random-number-generation -out path-to-private-key-file bit-length-of-private-key [bit-length-of-the-private-key]
The path of the openssl.bat is JP1/AJS3-Web-Console-installation-folder\uCPSB\httpsd\sbin\openssl.bat.
For details about execution permission required for the openssl.bat, see the official website of OpenSSL.
- In Linux:
openssl.sh genrsa -rand name-of-the-file-to-be-used-for-random-number-generation -out path-to-private-key-file it-length-of-private-key [bit-length-of-the-private-key]
The path of the openssl.sh is opt/jp1ajs3web/uCPSB/httpsd/sbin/openssl.sh.
For details about execution permission required for the openssl.sh, see the official website of OpenSSL.
To create an ECDSA certificate:
- In Windows:
openssl.bat ecparam -genkey -noout -rand name-of-the-file-to-be-used-for-random-number-generation -name elliptic-curve-name -out path-to-private-key-file
The path of the openssl.bat is JP1/AJS3-Web-Console-installation-folder\uCPSB\httpsd\sbin\openssl.bat.
For details about execution permission required for the openssl.bat, see the official website of OpenSSL.
- In Linux:
openssl.sh ecparam -genkey -noout -rand name-of-the-file-to-be-used-for-random-number-generation[:name-of-the-file-to-be-used-for-random-number-generation ...] -name elliptic-curve-name -out path-to-private-key-file
The path of the openssl.sh is opt/jp1ajs3web/uCPSB/httpsd/sbin/openssl.sh.
For details about execution permission required for the openssl.sh, see the official website of OpenSSL.
- Parameters
-
- -rand file-name-to-be-used-for-random-number-generation
-
Specify any file to be used for random number generation. You must specify an appropriate file whose size is large enough for the random number generation (for example, C:\Windows\system32\notepad.exe).
- -out key-file
-
Specify the file to which the private key is output.
- bit-length-of-the-private-key
-
For the openssl.bat genrsa command or the openssl.sh genrsa command, specify the bit length of the private key to be created. Specifiable bit lengths are as follows:
-
512
-
1024
-
2048
-
4096
If this argument is omitted, specification of 2048 is assumed.
-
- -name elliptic-curve-name
-
Specify the name of the elliptic curve to be used for generating a private key. You can specify one of the following names:
-
secp384r1
-
secp521r1
-
prime256v1
-
P-256
-
P-384
-
P-521
-
- Usage example 1
-
To create a private key (httpsdkey.pem) by using the openssl.bat genrsa command:
openssl.bat genrsa -rand C:\Windows\system32\notepad.exe -out httpsdkey.pem 2048
- Usage example 2
-
To create a ECDSA certificate by using the openssl.bat ecparam command:
openssl.bat ecparam -genkey -noout -rand C:\Windows\system32\notepad.exe -name P-256 -out httpsdkey.pem