Skip to content

Commit 075ddef

Browse files
committed
8364039: Adding implNote to DOMSignContext and DOMValidateContext on JDK-specific properties
Reviewed-by: mullan
1 parent bd4c0f4 commit 075ddef

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/dom/DOMSignContext.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import javax.xml.crypto.dsig.XMLSignature;
3434
import java.security.Key;
3535
import java.security.PrivateKey;
36+
import java.security.Provider;
3637
import java.security.SecureRandom;
3738
import java.security.Signature;
3839

@@ -51,9 +52,12 @@
5152
* instance to sign two different {@link XMLSignature} objects).
5253
*
5354
* @implNote
54-
* The JDK implementation supports the following property that can be set
55+
* The JDK implementation supports the following properties that can be set
5556
* using the {@link #setProperty setProperty} method.
5657
* <ul>
58+
* <li><code>org.jcp.xml.dsig.internal.dom.SignatureProvider</code>: value
59+
* must be a {@link Provider}. If specified, the underlying {@code Signature}
60+
* will be instantiated from this provider.
5761
* <li><code>jdk.xmldsig.SecureRandom</code>: value must be a
5862
* {@link SecureRandom}. If specified, this object will be
5963
* used to initialize the underlying {@code Signature} during signing

src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
3333
import javax.xml.crypto.dsig.XMLSignatureFactory;
3434
import javax.xml.crypto.dsig.XMLValidateContext;
3535
import java.security.Key;
36+
import java.security.Provider;
37+
3638
import org.w3c.dom.Node;
3739

3840
/**
@@ -52,18 +54,28 @@
5254
* instance to validate two different {@link XMLSignature} objects).
5355
*
5456
* @implNote
55-
* By default, the JDK implementation enables a secure validation mode by
56-
* setting the <code>org.jcp.xml.dsig.secureValidation</code> property to
57-
* <code>Boolean.TRUE</code> (see the {@link #setProperty setProperty}
58-
* method). When enabled, validation of XML signatures are subject to
59-
* stricter checking of algorithms and other constraints as specified by the
60-
* <code>jdk.xml.dsig.secureValidationPolicy</code> security property.
61-
* The mode can be disabled by setting the property to {@code Boolean.FALSE}.
62-
* The mode can also be enabled or disabled by setting the
63-
* {@systemProperty org.jcp.xml.dsig.secureValidation} system property to
64-
* "true" or "false". Any other value for the system property is also treated
65-
* as "false". If the system property is set, it supersedes the
66-
* {@code DOMValidateContext} property value.
57+
* The JDK implementation supports the following properties that can be set
58+
* using the {@link #setProperty setProperty} method.
59+
* <ul>
60+
* <li><code>org.jcp.xml.dsig.secureValidation</code>: value must be a
61+
* {@link Boolean}. When enabled, validation of XML signatures are subject
62+
* to stricter checking of algorithms and other constraints as specified by the
63+
* <code>jdk.xml.dsig.secureValidationPolicy</code> security property.
64+
* The default value if not specified is <code>Boolean.TRUE</code>.
65+
* The mode can be disabled by setting the property to {@code Boolean.FALSE}.
66+
* The mode can also be enabled or disabled by setting the
67+
* {@systemProperty org.jcp.xml.dsig.secureValidation} system property to
68+
* "true" or "false". Any other value for the system property is also treated
69+
* as "false". If the system property is set, it supersedes the
70+
* {@code DOMValidateContext} property value.
71+
* <li><code>org.jcp.xml.dsig.validateManifests</code>: value
72+
* must be a {@link Boolean}. If enabled, the references in manifest
73+
* elements (if exist) are validated during signature validation.
74+
* The default value if not specified is <code>Boolean.FALSE</code>.
75+
* <li><code>org.jcp.xml.dsig.internal.dom.SignatureProvider</code>: value
76+
* must be a {@link Provider}. If specified, the underlying {@code Signature}
77+
* will be instantiated from this provider.
78+
* </ul>
6779
*
6880
* @author Sean Mullan
6981
* @author JSR 105 Expert Group

0 commit comments

Comments
 (0)