nerdexam
CompTIA

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.

Security

Question

What openssl command will generate a selfsigned test certificate?

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)
  • A
    90% (26)
  • C
    3% (1)
  • D
    7% (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.

Aopenssl req new x509 key privkey.pem out cacert.pem days 365Correct

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.

Bopenssl sign key privkey.pem out cacert.pem days 365

There is no openssl sign subcommand for this purpose; signing is typically part of other openssl operations like req or x509.

Copenssl req key privkey.pem out cacert.pem days 365

Omitting the x509 option would generate a Certificate Signing Request (CSR) instead of a self-signed certificate.

Dopenssl sign new x509 key privkey.pem out cacert.pem days 365

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

#OpenSSL#self-signed certificate#X.509

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice