Author: anil.saldhana(a)jboss.com
Date: 2009-02-19 17:12:12 -0500 (Thu, 19 Feb 2009)
New Revision: 337
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
Log:
refactor constant
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java 2009-02-19
22:03:43 UTC (rev 336)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java 2009-02-19
22:12:12 UTC (rev 337)
@@ -48,6 +48,7 @@
*/
public class XMLEncryptionUtil
{
+ public static final String XMLNS = "http://www.w3.org/2000/xmlns/";
private static String XMLSIG_NS = JBossSAMLURIConstants.XMLDSIG_NSURI.get();
private static String XMLENC_NS = JBossSAMLURIConstants.XMLENC_NSURI.get();
@@ -123,7 +124,7 @@
Element wrappingElement =
encryptedDoc.createElementNS(wrappingElementQName.getNamespaceURI(),
wrappingElementQName.getPrefix() + ":" +
wrappingElementQName.getLocalPart());
-
wrappingElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
+ wrappingElement.setAttributeNS(XMLNS,
"xmlns:" + wrappingElementQName.getPrefix(),
wrappingElementQName.getNamespaceURI());
Element encryptedDocRootElement = encryptedDoc.getDocumentElement();
@@ -136,7 +137,7 @@
{
// Outer ds:KeyInfo Element to hold the EncryptionKey
Element sigElement = encryptedDoc.createElementNS(XMLSIG_NS,
"ds:KeyInfo");
-
sigElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:ds", XMLSIG_NS);
+ sigElement.setAttributeNS(XMLNS, "xmlns:ds", XMLSIG_NS);
sigElement.appendChild(encryptedKeyElement);
//Insert the Encrypted key before the CipherData element