RFR: 8256363: Define toString() for MGF1ParameterSpec [v2]

Valerie Peng valeriep at openjdk.java.net
Mon Nov 16 18:40:06 UTC 2020


On Mon, 16 Nov 2020 18:07:39 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> src/java.base/share/classes/java/security/spec/MGF1ParameterSpec.java line 168:
>> 
>>> 166:     @Override
>>> 167:     public String toString() {
>>> 168:         return "MGF1:" + mdName;
>> 
>> do you want to insert a space after ':' ?
>
> The current MGF part shows `MGF: MGF1:SHA-256`. An extra space would looks a little strange, and you don't know if the key is `MGF: MGF1` or ``MGF`. I'd rather keep the current output.

How about just MGF: MGF1SHA-256 or MGF: MGF1 SHA-256?
First combines into a single string, the second uses space instead of ":". Just a suggestion.

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

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



More information about the security-dev mailing list