-
CSR
-
Resolution: Approved
-
P4
-
None
-
minimal
-
Java API
-
SE
Summary
Add String constants for the Canonical XML 1.1 URIs to the javax.xml.crypto.dsig.CanonicalizationMethod
API.
Problem
Section 6.5.2 of the W3C Recommendation for XML Signature 1.1 defines algorithm URIs for Canonical XML 1.1. However, there are no String constants defined in the API, which means that applications must hard-code the URI, as follows, which is not user-friendly and can be error-prone:
CanonicalizationMethod cm = XMLSignatureFactory.getInstance()
.newCanonicalizationMethod("http://www.w3.org/2006/12/xml-c14n11", ...);
The other supported C14N algorithms already have String constants defined in the CanonicalizationMethod API.
Solution
- Add two new String constants for the Canonical XML 1.1 and Canonical XML 1.1 with Comments URIs.
- Add these URIs to the XML Signature Transform (TransformService) Algorithms section of the Standard Algorithm Names specification.
Specification
javax.xml.crypto.dsig.CanonicalizationMethod
:
/**
* The <a href="https://www.w3.org/TR/xml-c14n11/">Canonical XML 1.1
* (without comments)</a> canonicalization method algorithm URI.
*
* @since 13
*/
final static String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";
/**
* The <a href="https://www.w3.org/TR/xml-c14n11/#WithComments">
* Canonical XML 1.1 with comments</a> canonicalization method algorithm
* URI.
*
* @since 13
*/
final static String INCLUSIVE_11_WITH_COMMENTS =
"http://www.w3.org/2006/12/xml-c14n11#WithComments";
XML Signature Transform (TransformService) Algorithms section of the Standard Algorithm Names specification:
Algorithm URI | Description |
---|---|
http://www.w3.org/2006/12/xml-c14n11 (CanonicalizationMethod.INCLUSIVE_11) | The Canonical XML 1.1 (without comments) canonicalization algorithm. |
http://www.w3.org/2006/12/xml-c14n11#WithComments (CanonicalizationMethod.INCLUSIVE_11_WITH_COMMENTS) | The Canonical XML 1.1 with comments canonicalization algorithm. |
- csr of
-
JDK-8224767 Add String constants for Canonical XML 1.1 URIs
-
- Resolved
-