ws-wss4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r781002 - in /webservices/wss4j/trunk/src/org/apache/ws/security: WSConstants.java message/WSSecDKSign.java message/WSSecSignature.java
Date Tue, 02 Jun 2009 11:06:17 GMT
Author: coheigea
Date: Tue Jun  2 11:06:16 2009
New Revision: 781002

URL: http://svn.apache.org/viewvc?rev=781002&view=rev
Log:
Changed some namespace definitions to use XML-Security constants instead.

Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/WSConstants.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignature.java

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/WSConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/WSConstants.java?rev=781002&r1=781001&r2=781002&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/WSConstants.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/WSConstants.java Tue Jun  2 11:06:16
2009
@@ -23,6 +23,7 @@
 
 import org.apache.xml.security.c14n.Canonicalizer;
 import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.utils.Constants;
 import org.apache.xml.security.utils.EncryptionConstants;
 
 /**
@@ -39,7 +40,7 @@
     public static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
     
     /*
-     * The base UIRs for the various profiles.
+     * The base URIs for the various profiles.
      */
     public static final String SOAPMESSAGE_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0";
     public static final String SOAPMESSAGE_NS11 = "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1";
@@ -85,10 +86,10 @@
     /*
      * Now the namespaces, local names, and prefixes of XML-SIG and XML-ENC
      */
-    public static final String SIG_NS = "http://www.w3.org/2000/09/xmldsig#";
+    public static final String SIG_NS = Constants.SignatureSpecNS;
     public static final String SIG_PREFIX = "ds";
     public static final String SIG_LN = "Signature";
-    public static final String ENC_NS = "http://www.w3.org/2001/04/xmlenc#";
+    public static final String ENC_NS = EncryptionConstants.EncryptionSpecNS;
     public static final String ENC_PREFIX = "xenc";
     public static final String ENC_KEY_LN = "EncryptedKey";
     public static final String ENC_DATA_LN = "EncryptedData";
@@ -97,8 +98,8 @@
     /*
      * The standard namespace definitions
      */
-    public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
-    public static final String XML_NS = "http://www.w3.org/XML/1998/namespace";
+    public static final String XMLNS_NS = Constants.NamespaceSpecNS;
+    public static final String XML_NS = Constants.XML_LANG_SPACE_SpecNS;
     
     /*
      * The local names and attribute names used by WSS

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java?rev=781002&r1=781001&r2=781002&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java Tue Jun  2
11:06:16 2009
@@ -35,6 +35,7 @@
 import org.apache.xml.security.keys.KeyInfo;
 import org.apache.xml.security.signature.XMLSignature;
 import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.utils.Constants;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import java.util.List;
@@ -52,7 +53,7 @@
     private static Log log = LogFactory.getLog(WSSecDKSign.class.getName());
 
     protected String sigAlgo = XMLSignature.ALGO_ID_MAC_HMAC_SHA1;
-    protected String digestAlgo = "http://www.w3.org/2000/09/xmldsig#sha1";
+    protected String digestAlgo = Constants.ALGO_ID_DIGEST_SHA1;
     protected String canonAlgo = Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS;
     protected byte[] signatureValue = null;
     
@@ -116,7 +117,7 @@
         }
         
         sig.addResourceResolver(EnvelopeIdResolver.getInstance());
-        String sigUri = wssConfig.getIdAllocator().createId("Sig-", sig);
+        String sigUri = wssConfig.getIdAllocator().createId("SIG-", sig);
         sig.setId(sigUri);
         
         keyInfo = sig.getKeyInfo();
@@ -226,7 +227,7 @@
     }
     
     /**
-     * Set the digest algorithm to use. The default is SHA-1.
+     * Set the digest algorithm to use. The default is Constants.ALGO_ID_DIGEST_SHA1.
      * @param algorithm the digest algorithm to use.
      */
     public void setDigestAlgorithm(String algorithm) {

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignature.java?rev=781002&r1=781001&r2=781002&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignature.java Tue Jun
 2 11:06:16 2009
@@ -100,7 +100,7 @@
     private Crypto crypto = null;
     private String customTokenValueType;
     private String customTokenId;
-    private String digestAlgo = "http://www.w3.org/2000/09/xmldsig#sha1";
+    private String digestAlgo = Constants.ALGO_ID_DIGEST_SHA1;
     private X509Certificate useThisCert = null;
 
    
@@ -156,7 +156,7 @@
         }
 
         sig.addResourceResolver(EnvelopeIdResolver.getInstance());
-        sig.setId(wssConfig.getIdAllocator().createId("Sig-", sig));
+        sig.setId(wssConfig.getIdAllocator().createId("SIG-", sig));
 
         keyInfo = sig.getKeyInfo();
         keyInfoUri = wssConfig.getIdAllocator().createSecureId("KI-", keyInfo);
@@ -720,7 +720,8 @@
     }
 
     /**
-     * Set the string that defines which digest algorithm to use. The default is SHA-1.
+     * Set the string that defines which digest algorithm to use. 
+     * The default is Constants.ALGO_ID_DIGEST_SHA1.
      * 
      * @param digestAlgo the digestAlgo to set
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Mime
View raw message