File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed
src/java.base/share/classes Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 25
25
26
26
package java .security .spec ;
27
27
28
- import java .security .spec .AlgorithmParameterSpec ;
29
-
30
28
/**
31
29
* This class specifies the set of parameters used with mask generation
32
30
* function MGF1 in OAEP Padding and RSASSA-PSS signature scheme, as
@@ -162,4 +160,9 @@ public MGF1ParameterSpec(String mdName) {
162
160
public String getDigestAlgorithm () {
163
161
return mdName ;
164
162
}
163
+
164
+ @ Override
165
+ public String toString () {
166
+ return "MGF1ParameterSpec[hashAlgorithm=" + mdName + "]" ;
167
+ }
165
168
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2001, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2001, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -220,11 +220,12 @@ public int getTrailerField() {
220
220
221
221
@ Override
222
222
public String toString () {
223
- StringBuilder sb = new StringBuilder ();
224
- sb .append ("MD: " + mdName + "\n " )
225
- .append ("MGF: " + mgfSpec + "\n " )
226
- .append ("SaltLength: " + saltLen + "\n " )
227
- .append ("TrailerField: " + trailerField + "\n " );
223
+ StringBuilder sb = new StringBuilder ("PSSParameterSpec[" );
224
+ sb .append ("hashAlgorithm=" + mdName + ", " )
225
+ .append ("maskGenAlgorithm=" + mgfSpec + ", " )
226
+ .append ("saltLength=" + saltLen + ", " )
227
+ .append ("trailerField=" + trailerField )
228
+ .append (']' );
228
229
return sb .toString ();
229
230
}
230
231
}
Original file line number Diff line number Diff line change @@ -510,15 +510,15 @@ public static String getDefaultSigAlgForKey(PrivateKey k) {
510
510
private static class PSSParamsHolder {
511
511
final static PSSParameterSpec PSS_256_SPEC = new PSSParameterSpec (
512
512
"SHA-256" , "MGF1" ,
513
- new MGF1ParameterSpec ( "SHA-256" ) ,
513
+ MGF1ParameterSpec . SHA256 ,
514
514
32 , PSSParameterSpec .TRAILER_FIELD_BC );
515
515
final static PSSParameterSpec PSS_384_SPEC = new PSSParameterSpec (
516
516
"SHA-384" , "MGF1" ,
517
- new MGF1ParameterSpec ( "SHA-384" ) ,
517
+ MGF1ParameterSpec . SHA384 ,
518
518
48 , PSSParameterSpec .TRAILER_FIELD_BC );
519
519
final static PSSParameterSpec PSS_512_SPEC = new PSSParameterSpec (
520
520
"SHA-512" , "MGF1" ,
521
- new MGF1ParameterSpec ( "SHA-512" ) ,
521
+ MGF1ParameterSpec . SHA512 ,
522
522
64 , PSSParameterSpec .TRAILER_FIELD_BC );
523
523
}
524
524
You can’t perform that action at this time.
0 commit comments