LX0-104 · Question #425
What openssl command will generate a selfsigned test certificate?
The correct answer is A. openssl req new x509 key privkey.pem out cacert.pem days 365. A self-signed certificate can be generated using the openssl req command with the new and x509 options, specifying the private key and validity period.
Question
Options
- Aopenssl req new x509 key privkey.pem out cacert.pem days 365
- Bopenssl sign key privkey.pem out cacert.pem days 365
- Copenssl req key privkey.pem out cacert.pem days 365
- Dopenssl sign new x509 key privkey.pem out cacert.pem days 365
How the community answered
(29 responses)- A90% (26)
- C3% (1)
- D7% (2)
Why each option
A self-signed certificate can be generated using the openssl req command with the new and x509 options, specifying the private key and validity period.
The openssl req command creates a CSR, but when combined with the -x509 option, it generates a self-signed certificate directly instead of a CSR. The new option indicates it's a new certificate, key privkey.pem specifies the private key to sign the certificate itself, out cacert.pem is the output file, and days 365 sets the certificate's validity period.
There is no openssl sign subcommand for this purpose; signing is typically part of other openssl operations like req or x509.
Omitting the x509 option would generate a Certificate Signing Request (CSR) instead of a self-signed certificate.
This option uses the non-existent openssl sign subcommand.
Concept tested: OpenSSL self-signed certificate generation
Source: https://www.openssl.org/docs/manmaster/man1/openssl-req.html
Topics
Community Discussion
No community discussion yet for this question.