author | jlaskey |
Thu, 21 Jun 2018 08:58:59 -0300 | |
changeset 50695 | 36ca515343e0 |
parent 50614 | 3810c9a2efa1 |
child 59240 | b3116877866f |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* reserved comment block |
|
3 |
* DO NOT REMOVE OR ALTER! |
|
4 |
*/ |
|
18240 | 5 |
/** |
6 |
* Licensed to the Apache Software Foundation (ASF) under one |
|
7 |
* or more contributor license agreements. See the NOTICE file |
|
8 |
* distributed with this work for additional information |
|
9 |
* regarding copyright ownership. The ASF licenses this file |
|
10 |
* to you under the Apache License, Version 2.0 (the |
|
11 |
* "License"); you may not use this file except in compliance |
|
12 |
* with the License. You may obtain a copy of the License at |
|
2 | 13 |
* |
18240 | 14 |
* http://www.apache.org/licenses/LICENSE-2.0 |
2 | 15 |
* |
18240 | 16 |
* Unless required by applicable law or agreed to in writing, |
17 |
* software distributed under the License is distributed on an |
|
18 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
19 |
* KIND, either express or implied. See the License for the |
|
20 |
* specific language governing permissions and limitations |
|
21 |
* under the License. |
|
2 | 22 |
*/ |
23 |
package com.sun.org.apache.xml.internal.security; |
|
24 |
||
25 |
import java.io.InputStream; |
|
26 |
import java.security.AccessController; |
|
27 |
import java.security.PrivilegedAction; |
|
27081 | 28 |
import java.security.PrivilegedActionException; |
29 |
import java.security.PrivilegedExceptionAction; |
|
18240 | 30 |
import java.util.ArrayList; |
31 |
import java.util.List; |
|
32 |
||
2 | 33 |
import javax.xml.parsers.DocumentBuilder; |
34 |
||
35 |
import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper; |
|
36 |
import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; |
|
37 |
import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; |
|
27081 | 38 |
import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; |
2 | 39 |
import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolver; |
40 |
import com.sun.org.apache.xml.internal.security.transforms.Transform; |
|
18240 | 41 |
import com.sun.org.apache.xml.internal.security.utils.ElementProxy; |
2 | 42 |
import com.sun.org.apache.xml.internal.security.utils.I18n; |
43 |
import com.sun.org.apache.xml.internal.security.utils.XMLUtils; |
|
44 |
import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; |
|
45 |
import org.w3c.dom.Attr; |
|
46 |
import org.w3c.dom.Document; |
|
47 |
import org.w3c.dom.Element; |
|
48 |
import org.w3c.dom.Node; |
|
49 |
||
50 |
||
51 |
/** |
|
52 |
* This class does the configuration of the library. This includes creating |
|
53 |
* the mapping of Canonicalization and Transform algorithms. Initialization is |
|
54 |
* done by calling {@link Init#init} which should be done in any static block |
|
55 |
* of the files of this library. We ensure that this call is only executed once. |
|
56 |
*/ |
|
18240 | 57 |
public class Init { |
2 | 58 |
|
18240 | 59 |
/** The namespace for CONF file **/ |
60 |
public static final String CONF_NS = "http://www.xmlsecurity.org/NS/#configuration"; |
|
61 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
62 |
private static final com.sun.org.slf4j.internal.Logger LOG = |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
63 |
com.sun.org.slf4j.internal.LoggerFactory.getLogger(Init.class); |
2 | 64 |
|
18240 | 65 |
/** Field alreadyInitialized */ |
66 |
private static boolean alreadyInitialized = false; |
|
2 | 67 |
|
18240 | 68 |
/** |
69 |
* Method isInitialized |
|
70 |
* @return true if the library is already initialized. |
|
71 |
*/ |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
72 |
public static final synchronized boolean isInitialized() { |
18240 | 73 |
return Init.alreadyInitialized; |
74 |
} |
|
75 |
||
76 |
/** |
|
77 |
* Method init |
|
78 |
* |
|
79 |
*/ |
|
80 |
public static synchronized void init() { |
|
81 |
if (alreadyInitialized) { |
|
82 |
return; |
|
83 |
} |
|
2 | 84 |
|
18240 | 85 |
InputStream is = |
86 |
AccessController.doPrivileged( |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
87 |
(PrivilegedAction<InputStream>) |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
88 |
() -> { |
18240 | 89 |
String cfile = |
90 |
System.getProperty("com.sun.org.apache.xml.internal.security.resource.config"); |
|
91 |
if (cfile == null) { |
|
92 |
return null; |
|
93 |
} |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
94 |
return Init.class.getResourceAsStream(cfile); |
18240 | 95 |
} |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
96 |
); |
18240 | 97 |
if (is == null) { |
98 |
dynamicInit(); |
|
99 |
} else { |
|
100 |
fileInit(is); |
|
101 |
} |
|
2 | 102 |
|
18240 | 103 |
alreadyInitialized = true; |
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* Dynamically initialise the library by registering the default algorithms/implementations |
|
108 |
*/ |
|
109 |
private static void dynamicInit() { |
|
110 |
// |
|
111 |
// Load the Resource Bundle - the default is the English resource bundle. |
|
112 |
// To load another resource bundle, call I18n.init(...) before calling this |
|
113 |
// method. |
|
114 |
// |
|
115 |
I18n.init("en", "US"); |
|
2 | 116 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
117 |
LOG.debug("Registering default algorithms"); |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
118 |
|
18240 | 119 |
try { |
27081 | 120 |
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>(){ |
121 |
@Override public Void run() throws XMLSecurityException { |
|
122 |
// |
|
123 |
// Bind the default prefixes |
|
124 |
// |
|
125 |
ElementProxy.registerDefaultPrefixes(); |
|
18240 | 126 |
|
27081 | 127 |
// |
128 |
// Set the default Transforms |
|
129 |
// |
|
130 |
Transform.registerDefaultAlgorithms(); |
|
18240 | 131 |
|
27081 | 132 |
// |
133 |
// Set the default signature algorithms |
|
134 |
// |
|
135 |
SignatureAlgorithm.registerDefaultAlgorithms(); |
|
136 |
||
137 |
// |
|
138 |
// Set the default JCE algorithms |
|
139 |
// |
|
140 |
JCEMapper.registerDefaultAlgorithms(); |
|
18240 | 141 |
|
27081 | 142 |
// |
143 |
// Set the default c14n algorithms |
|
144 |
// |
|
145 |
Canonicalizer.registerDefaultAlgorithms(); |
|
2 | 146 |
|
27081 | 147 |
// |
148 |
// Register the default resolvers |
|
149 |
// |
|
150 |
ResourceResolver.registerDefaultResolvers(); |
|
2 | 151 |
|
27081 | 152 |
// |
153 |
// Register the default key resolvers |
|
154 |
// |
|
155 |
KeyResolver.registerDefaultResolvers(); |
|
2 | 156 |
|
27081 | 157 |
return null; |
158 |
} |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
159 |
}); |
27081 | 160 |
} catch (PrivilegedActionException ex) { |
161 |
XMLSecurityException xse = (XMLSecurityException)ex.getException(); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
162 |
LOG.error(xse.getMessage(), xse); |
27081 | 163 |
xse.printStackTrace(); |
18240 | 164 |
} |
165 |
} |
|
2 | 166 |
|
18240 | 167 |
/** |
168 |
* Initialise the library from a configuration file |
|
169 |
*/ |
|
170 |
private static void fileInit(InputStream is) { |
|
171 |
try { |
|
2 | 172 |
/* read library configuration file */ |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
173 |
DocumentBuilder db = XMLUtils.createDocumentBuilder(false); |
2 | 174 |
Document doc = db.parse(is); |
18240 | 175 |
Node config = doc.getFirstChild(); |
176 |
for (; config != null; config = config.getNextSibling()) { |
|
2 | 177 |
if ("Configuration".equals(config.getLocalName())) { |
18240 | 178 |
break; |
2 | 179 |
} |
180 |
} |
|
18240 | 181 |
if (config == null) { |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
182 |
LOG.error("Error in reading configuration file - Configuration element not found"); |
18240 | 183 |
return; |
184 |
} |
|
185 |
for (Node el = config.getFirstChild(); el != null; el = el.getNextSibling()) { |
|
186 |
if (Node.ELEMENT_NODE != el.getNodeType()) { |
|
187 |
continue; |
|
188 |
} |
|
189 |
String tag = el.getLocalName(); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
190 |
if ("ResourceBundles".equals(tag)) { |
18240 | 191 |
Element resource = (Element)el; |
192 |
/* configure internationalization */ |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
193 |
Attr langAttr = resource.getAttributeNodeNS(null, "defaultLanguageCode"); |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
194 |
Attr countryAttr = resource.getAttributeNodeNS(null, "defaultCountryCode"); |
18240 | 195 |
String languageCode = |
196 |
(langAttr == null) ? null : langAttr.getNodeValue(); |
|
197 |
String countryCode = |
|
198 |
(countryAttr == null) ? null : countryAttr.getNodeValue(); |
|
199 |
I18n.init(languageCode, countryCode); |
|
2 | 200 |
} |
18240 | 201 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
202 |
if ("CanonicalizationMethods".equals(tag)) { |
18240 | 203 |
Element[] list = |
204 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "CanonicalizationMethod"); |
|
205 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
206 |
for (Element element : list) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
207 |
String uri = element.getAttributeNS(null, "URI"); |
18240 | 208 |
String javaClass = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
209 |
element.getAttributeNS(null, "JAVACLASS"); |
18240 | 210 |
try { |
211 |
Canonicalizer.register(uri, javaClass); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
212 |
LOG.debug("Canonicalizer.register({}, {})", uri, javaClass); |
18240 | 213 |
} catch (ClassNotFoundException e) { |
214 |
Object exArgs[] = { uri, javaClass }; |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
215 |
LOG.error(I18n.translate("algorithm.classDoesNotExist", exArgs)); |
18240 | 216 |
} |
217 |
} |
|
218 |
} |
|
219 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
220 |
if ("TransformAlgorithms".equals(tag)) { |
18240 | 221 |
Element[] tranElem = |
222 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "TransformAlgorithm"); |
|
2 | 223 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
224 |
for (Element element : tranElem) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
225 |
String uri = element.getAttributeNS(null, "URI"); |
18240 | 226 |
String javaClass = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
227 |
element.getAttributeNS(null, "JAVACLASS"); |
18240 | 228 |
try { |
229 |
Transform.register(uri, javaClass); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
230 |
LOG.debug("Transform.register({}, {})", uri, javaClass); |
18240 | 231 |
} catch (ClassNotFoundException e) { |
232 |
Object exArgs[] = { uri, javaClass }; |
|
2 | 233 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
234 |
LOG.error(I18n.translate("algorithm.classDoesNotExist", exArgs)); |
18240 | 235 |
} catch (NoClassDefFoundError ex) { |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
236 |
LOG.warn("Not able to found dependencies for algorithm, I'll keep working."); |
18240 | 237 |
} |
238 |
} |
|
239 |
} |
|
2 | 240 |
|
18240 | 241 |
if ("JCEAlgorithmMappings".equals(tag)) { |
242 |
Node algorithmsNode = ((Element)el).getElementsByTagName("Algorithms").item(0); |
|
243 |
if (algorithmsNode != null) { |
|
244 |
Element[] algorithms = |
|
245 |
XMLUtils.selectNodes(algorithmsNode.getFirstChild(), CONF_NS, "Algorithm"); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
246 |
for (Element element : algorithms) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
247 |
String id = element.getAttributeNS(null, "URI"); |
18240 | 248 |
JCEMapper.register(id, new JCEMapper.Algorithm(element)); |
2 | 249 |
} |
18240 | 250 |
} |
251 |
} |
|
252 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
253 |
if ("SignatureAlgorithms".equals(tag)) { |
18240 | 254 |
Element[] sigElems = |
255 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "SignatureAlgorithm"); |
|
256 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
257 |
for (Element sigElem : sigElems) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
258 |
String uri = sigElem.getAttributeNS(null, "URI"); |
18240 | 259 |
String javaClass = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
260 |
sigElem.getAttributeNS(null, "JAVACLASS"); |
18240 | 261 |
|
262 |
/** $todo$ handle registering */ |
|
2 | 263 |
|
18240 | 264 |
try { |
265 |
SignatureAlgorithm.register(uri, javaClass); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
266 |
LOG.debug("SignatureAlgorithm.register({}, {})", uri, javaClass); |
18240 | 267 |
} catch (ClassNotFoundException e) { |
268 |
Object exArgs[] = { uri, javaClass }; |
|
2 | 269 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
270 |
LOG.error(I18n.translate("algorithm.classDoesNotExist", exArgs)); |
18240 | 271 |
} |
272 |
} |
|
273 |
} |
|
2 | 274 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
275 |
if ("ResourceResolvers".equals(tag)) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
276 |
Element[] resolverElem = |
18240 | 277 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "Resolver"); |
278 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
279 |
for (Element element : resolverElem) { |
18240 | 280 |
String javaClass = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
281 |
element.getAttributeNS(null, "JAVACLASS"); |
18240 | 282 |
String description = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
283 |
element.getAttributeNS(null, "DESCRIPTION"); |
2 | 284 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
285 |
if (description != null && description.length() > 0) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
286 |
LOG.debug("Register Resolver: {}: {}", javaClass, description); |
18240 | 287 |
} else { |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
288 |
LOG.debug("Register Resolver: {}: For unknown purposes", javaClass); |
18240 | 289 |
} |
290 |
try { |
|
291 |
ResourceResolver.register(javaClass); |
|
292 |
} catch (Throwable e) { |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
293 |
LOG.warn( |
18240 | 294 |
"Cannot register:" + javaClass |
295 |
+ " perhaps some needed jars are not installed", |
|
296 |
e |
|
297 |
); |
|
298 |
} |
|
299 |
} |
|
300 |
} |
|
2 | 301 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
302 |
if ("KeyResolver".equals(tag)){ |
18240 | 303 |
Element[] resolverElem = |
304 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "Resolver"); |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
305 |
List<String> classNames = new ArrayList<>(resolverElem.length); |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
306 |
for (Element element : resolverElem) { |
18240 | 307 |
String javaClass = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
308 |
element.getAttributeNS(null, "JAVACLASS"); |
18240 | 309 |
String description = |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
310 |
element.getAttributeNS(null, "DESCRIPTION"); |
2 | 311 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
312 |
if (description != null && description.length() > 0) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
313 |
LOG.debug("Register Resolver: {}: {}", javaClass, description); |
18240 | 314 |
} else { |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
315 |
LOG.debug("Register Resolver: {}: For unknown purposes", javaClass); |
18240 | 316 |
} |
317 |
classNames.add(javaClass); |
|
318 |
} |
|
319 |
KeyResolver.registerClassNames(classNames); |
|
320 |
} |
|
2 | 321 |
|
322 |
||
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
323 |
if ("PrefixMappings".equals(tag)){ |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
324 |
LOG.debug("Now I try to bind prefixes:"); |
2 | 325 |
|
18240 | 326 |
Element[] nl = |
327 |
XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "PrefixMapping"); |
|
2 | 328 |
|
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
329 |
for (Element element : nl) { |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
330 |
String namespace = element.getAttributeNS(null, "namespace"); |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
331 |
String prefix = element.getAttributeNS(null, "prefix"); |
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
332 |
LOG.debug("Now I try to bind {} to {}", prefix, namespace); |
18240 | 333 |
ElementProxy.setDefaultPrefix(namespace, prefix); |
334 |
} |
|
335 |
} |
|
2 | 336 |
} |
18240 | 337 |
} catch (Exception e) { |
50614
3810c9a2efa1
8177334: Update xmldsig implementation to Apache Santuario 2.1.1
weijun
parents:
47216
diff
changeset
|
338 |
LOG.error("Bad: ", e); |
18240 | 339 |
} |
340 |
} |
|
2 | 341 |
|
342 |
} |
|
18240 | 343 |