openssl
- Organization of this page
Function
The openssl command is provided by OpenSSL.
Format
For details about the format (options) of the openssl command, see the official website of OpenSSL.
Required execution permission
For details about execution permission required for the openssl command, see the official website of OpenSSL.
Command directory
OS |
Command directory |
|
---|---|---|
Windows |
32-bit |
installation-folder\ssl\32mt\bin |
|
32-bit, multithread |
/opt/jp1base/ssl/32mt/bin |
32-bit, single thread |
/opt/jp1base/ssl/32st/bin |
|
Solaris |
32-bit, multithread |
/opt/jp1base/ssl/32mt/bin |
32-bit, single thread |
/opt/jp1base/ssl/32st/bin |
Notes
-
For the latest information about this command, see the official website of OpenSSL.
-
To use this command in Windows, you need to set the OPENSSL_CONF environment variable on the console that executes the command. Specify the OpenSSL definition file name by using its full path for the OPENSSL_CONF environment variable. JP1/Base provides the OpenSSL definition file in the following folder:
- In the 32-bit version of Windows:
-
installation-folder\ssl\32mt\ssl\openssl.cnf
- In the 64-bit version of Windows:
-
installation-folder\ssl\64mt\ssl\openssl.cnf
However, you must not set the OPENSSL_CONF environment variable for the user environment variable and system environment variable. Set the OPENSSL_CONF environment variable in either of the methods described below. Note that both methods are described on the assumption that the OS is the 32-bit version of Windows. For the 64-bit version of Windows, replace the storage folder of the OpenSSL definition file, for example, as necessary.
-
Setting method by creating a batch file
Create a batch file to set the OPENSSL_CONF environment variable and execute openssl.exe, and then execute the batch file on the console.
The contents of the batch file are as follows:
--------------------------------------
@echo off
set OPENSSL_CONF=installation-folder\ssl\32mt\ssl\openssl.cnf
"installation-folder\ssl\32mt\bin\openssl.exe" %*
exit /b %ERRORLEVEL%
--------------------------------------
Do not enclose the full path to be set in the OPENSSL_CONF environment variable by using double quotation marks ("").
In the following execution example, the batch file name is sslexe.bat.
sslexe.bat x509 -text -noout -in jp1basessl.pem
-
Setting method by executing the set command on the console
Execute the set command that is used to set the OPENSSL_CONF environment variable on the console. An example of executing the set command is as follows:
set OPENSSL_CONF=C:\Program Files (x86)\Hitachi\JP1Base\ssl\32mt\ssl\openssl.cnf
Do not enclose the full path to be set in the OPENSSL_CONF environment variable by using double quotation marks ("").
After executing the set command, execute openssl.exe.
Examples
The following shows examples of executing the openssl command.
- To create a private key jp1basesslkey.pem in RSA format:
openssl genrsa 2048 -out jp1basesslkey.pem
- To create a CSR jp1base.csr:
openssl req -key jp1basesslkey.pem -out jp1base.csr
- To check the expiration date of a server certificate jp1basessl.pem:
openssl x509 -text -noout -in jp1basessl.pem
Execution result (excerpts):
Validity Not Before: Jul 21 01:31:49 2015 GMT Not After: Jul 18 01:31:49 2025 GMT
Not Before indicates the date and time when the server certificate was issued.
Not After indicates the expiration date of the server certificate.