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

Sean Mullan mullan at openjdk.java.net
Mon Nov 16 16:14:09 UTC 2020


On Mon, 16 Nov 2020 14:25:20 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Without this method, `PSSParameterSpec::toString` shows something like:
>> MD: SHA-256
>> MGF: java.security.spec.MGF1ParameterSpec at 77b52d12
>> SaltLength: 32
>> TrailerField: 1
>> This is ugly.
>> 
>> Noreg-trivial.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   make PSSParameterSpec one line
>   
>   only in patch2:
>   unchanged:

src/java.base/share/classes/java/security/spec/PSSParameterSpec.java line 224:

> 222:     public String toString() {
> 223:         StringBuilder sb = new StringBuilder();
> 224:         sb.append("MD: " + mdName + ", ")

I would replace "MD" with "DigestAlgorithm" to be consistent with the names of the other fields.

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

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



More information about the security-dev mailing list