mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8272163: Add -version option to keytool and jarsigner
Reviewed-by: weijun
This commit is contained in:
parent
6523c558d9
commit
fec470f262
6 changed files with 213 additions and 1 deletions
|
@ -262,6 +262,7 @@ public final class Main {
|
|||
ADDPROVIDER, PROVIDERCLASS, PROVIDERPATH, V),
|
||||
SHOWINFO("showinfo.command.help",
|
||||
TLS, V),
|
||||
VERSION("Prints.the.program.version"),
|
||||
|
||||
// Undocumented start here, KEYCLONE is used a marker in -help;
|
||||
|
||||
|
@ -717,7 +718,7 @@ public final class Main {
|
|||
}
|
||||
|
||||
boolean isKeyStoreRelated(Command cmd) {
|
||||
return cmd != PRINTCERTREQ && cmd != SHOWINFO;
|
||||
return cmd != PRINTCERTREQ && cmd != SHOWINFO && cmd != VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1337,6 +1338,8 @@ public final class Main {
|
|||
doPrintCRL(filename, out);
|
||||
} else if (command == SHOWINFO) {
|
||||
doShowInfo();
|
||||
} else if (command == VERSION) {
|
||||
doPrintVersion();
|
||||
}
|
||||
|
||||
// If we need to save the keystore, do so.
|
||||
|
@ -2794,6 +2797,10 @@ public final class Main {
|
|||
}
|
||||
}
|
||||
|
||||
private void doPrintVersion() {
|
||||
System.out.println("keytool " + System.getProperty("java.version"));
|
||||
}
|
||||
|
||||
private Collection<? extends Certificate> generateCertificates(InputStream in)
|
||||
throws CertificateException, IOException {
|
||||
byte[] data = in.readAllBytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue