File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
test/jdk/javax/xml/crypto/dsig Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 21
21
* questions.
22
22
*/
23
23
24
+ /*
25
+ * ===========================================================================
26
+ * (c) Copyright IBM Corp. 2025, 2025 All Rights Reserved
27
+ * ===========================================================================
28
+ */
29
+
24
30
import jdk .test .lib .Asserts ;
25
31
import jdk .test .lib .Utils ;
26
32
import jdk .test .lib .security .XMLUtils ;
34
40
import javax .xml .crypto .dsig .dom .DOMValidateContext ;
35
41
import javax .xml .crypto .dsig .spec .RSAPSSParameterSpec ;
36
42
import java .security .KeyPairGenerator ;
43
+ import java .security .Signature ;
37
44
import java .security .spec .MGF1ParameterSpec ;
38
45
import java .security .spec .PSSParameterSpec ;
39
46
@@ -54,7 +61,20 @@ public class PSSSpec {
54
61
55
62
public static void main (String [] args ) throws Exception {
56
63
unmarshal ();
57
- marshal ();
64
+ try {
65
+ marshal ();
66
+ } catch (javax .xml .crypto .dsig .XMLSignatureException xmlse ) {
67
+ Throwable cause = xmlse .getCause ();
68
+ if (cause instanceof java .security .InvalidAlgorithmParameterException ) {
69
+ if (Signature .getInstance ("RSA-PSS" ).getProvider ().getName ().equals ("OpenJCEPlus" )
70
+ && cause .getMessage ().equals ("The message digest within the PSSParameterSpec does not match the MGF message digest." )
71
+ ) {
72
+ System .out .println ("Expected error message is caught for OpenJCEPlus provider." );
73
+ return ;
74
+ }
75
+ }
76
+ throw xmlse ;
77
+ }
58
78
spec ();
59
79
}
60
80
You can’t perform that action at this time.
0 commit comments