RFR: 8260693: Provide the support for specifying a signer in keytool -genkeypair [v4]

Hai-May Chao hchao at openjdk.java.net
Wed Apr 7 23:17:59 UTC 2021


On Fri, 2 Apr 2021 01:40:16 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Hai-May Chao has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   update with review comments
>
> src/java.base/share/classes/sun/security/tools/keytool/Main.java line 1978:
> 
>> 1976:                     keypair.getPublicKeyAnyway(),
>> 1977:                     signerSubjectKeyId);
>> 1978:         } else {
> 
> No need for an if-else block? `signerSubjectKeyId` is null in this case.

Removed.

> src/java.base/share/classes/sun/security/tools/keytool/Main.java line 2013:
> 
>> 2011:                     x500Name};
>> 2012:             System.err.println(form.format(source));
>> 2013:         }
> 
> Either put the declaration of `source` outside the if-else block and move the println line outside; or, move the declaration of `form` inside. It looks confusing that `form` is declared outside and `source` inside.

Done.

> src/java.base/share/classes/sun/security/tools/keytool/Resources.java line 310:
> 
>> 308:                 "Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"},
>> 309:         {"Generating.keysize.bit.keyAlgName.key.pair.and.a.certificate.sigAlgName.issued.by.an.entry.signerAlias.with.a.validity.of.validality.days.for",
>> 310:                 "Generating {0} bit {1} key pair and a certificate ({2}) issued by an entry <{3}> with a validity of {4} days\n\tfor: {5}"},
> 
> I feel "issued by <{3}>" sounds more normal. No need to say "an entry". You decide it.

Removed "an entry".

-------------

PR: https://git.openjdk.java.net/jdk/pull/3281


More information about the security-dev mailing list