简体   繁体   中英

Illegal option: -ext Try keytool

I am using java version "1.7.0_60" in linux machine but when trying to run -keytool command with -ext i am getting

Illegal option: -ext Try keytool -help

Can someone please tell me its due to java version issue or something else?

I check Oracle site the have mentioned -ext already there in Java7

EDIT:-

Here is the command

keytool -genkey -dname "CN=apptest2, OU=A, O=te ha,L=Delhi, S=Delhi, C=IN" -alias "ssocertificate" -keyalg RSA -keypass P@ssw0rd -keystore /etc/cas/certificate/portal.keystore –storepass storepass -keyalg "RSA" -ext SAN=dns:apptest2,ip:105.210.22.145

The option is still available in new Java versions, but it is not a top-level option. It is only applicable following a few particular options. From the man page:

Denotes an X.509 certificate extension. The option can be used in -genkeypair and -gencert to embed extensions into the certificate generated, or in -certreq to show what extensions are requested in the certificate request. The option can appear multiple times. The name argument can be a supported extension name (see Named Extensions) or an arbitrary OID number. The value argument, when provided, denotes the argument for the extension. When value is omitted, that means that the default value of the extension or the extension requires no argument. The :critical modifier, when provided, means the extension's isCritical attribute is true; otherwise, it is false. You can use :c in place of :critical.

You can see its help if you ask for help on an option like -gencert . Eg,

% keytool -help -gencert
keytool -gencert [OPTION]...
Options:
...
 -ext <value>       X.509 extension

I faced the same issue. System Path has multiple versions of JAVA reference. Removed the multiple references and installed the latest java version. This issue got fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM