500-444 · Question #12
Which keytool command lists certificates in the cacerts file?
The correct answer is B. keytool -list -keystore cacerts. keytool -list -keystore cacerts is correct because -list is the action flag and -keystore specifies which keystore file to operate on - together they list all certificate entries in the named keystore (cacerts is the JDK's default trust store). Why the distractors fail: A…
Question
Which keytool command lists certificates in the cacerts file?
Options
- Akeytool -list -showinfo
- Bkeytool -list -keystore cacerts
- Ckeytool -list cacerts
- Dkeytool -list -alias
How the community answered
(36 responses)- B89% (32)
- C8% (3)
- D3% (1)
Explanation
keytool -list -keystore cacerts is correct because -list is the action flag and -keystore specifies which keystore file to operate on - together they list all certificate entries in the named keystore (cacerts is the JDK's default trust store).
Why the distractors fail:
- A (
-showinfo) is not a valid keytool flag - it doesn't exist. - C (
keytool -list cacerts) treatscacertsas a positional argument, but keytool requires the-keystoreflag to identify the file; this command will error or prompt for a different keystore. - D (
-alias) narrows the listing to a single named alias, so without specifying an actual alias value and a keystore, it neither lists all certificates nor targets the cacerts file.
Memory tip: Think of keytool flags as always coming in -verb -noun value pairs - -list (what to do) + -keystore cacerts (where to do it). Any option without a proper -keystore flag is missing the "where," and any made-up flag like -showinfo simply won't run.
Topics
Community Discussion
No community discussion yet for this question.