You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2013/03/13 12:26:19 UTC

svn commit: r1455889 - in /webservices/wss4j/trunk: ws-security-common/src/site/xdoc/ ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/ ws-security-dom/src/main/java/org/apache/wss4j/dom/message/

Author: coheigea
Date: Wed Mar 13 11:26:18 2013
New Revision: 1455889

URL: http://svn.apache.org/r1455889
Log:
Some fixes around Key Identifiers


Conflicts:
	ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java

Modified:
    webservices/wss4j/trunk/ws-security-common/src/site/xdoc/config.xml
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java

Modified: webservices/wss4j/trunk/ws-security-common/src/site/xdoc/config.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/site/xdoc/config.xml?rev=1455889&r1=1455888&r2=1455889&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/site/xdoc/config.xml (original)
+++ webservices/wss4j/trunk/ws-security-common/src/site/xdoc/config.xml Wed Mar 13 11:26:18 2013
@@ -568,6 +568,9 @@ for SIG_KEY_ID and ENC_KEY_ID for more d
 <tr>
 <td>EncryptedKeySHA1</td>
 </tr>
+<tr>
+<td>KeyValue</td>
+</tr>
 </table>
 </subsection>
 </section>            

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java?rev=1455889&r1=1455888&r2=1455889&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java Wed Mar 13 11:26:18 2013
@@ -516,7 +516,8 @@ public abstract class WSHandler {
                     || tmp == WSConstants.X509_KEY_IDENTIFIER
                     || tmp == WSConstants.SKI_KEY_IDENTIFIER
                     || tmp == WSConstants.THUMBPRINT_IDENTIFIER
-                    || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER)) {
+                    || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER)
+                    || tmp == WSConstants.KEY_VALUE) {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                         "empty",
                         "WSHandler: Signature: illegal key identification"

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java?rev=1455889&r1=1455888&r2=1455889&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java Wed Mar 13 11:26:18 2013
@@ -523,8 +523,11 @@ public final class WSHandlerConstants {
     /**
      * Defines which key identifier type to use for signature. The WS-Security specifications
      * recommends to use the identifier type <code>IssuerSerial</code>. For possible signature 
-     * key identifier types refer to {@link #keyIdentifier}. 
-     * For signature <code>IssuerSerial</code> and <code>DirectReference</code> are valid only.
+     * key identifier types refer to {@link #getKeyIdentifier(String)}. 
+     * For signature <code>IssuerSerial</code>, <code>DirectReference</code>,
+     * <code>X509KeyIdentifier</code>, <code>Thumbprint</code>, <code>SKIKeyIdentifier</code>
+     * and <code>KeyValue</code> are valid only. 
+     * <p/>
      * The default is <code>IssuerSerial</code>.
      * <p/>
      * The application may set this parameter using the following method:
@@ -607,10 +610,12 @@ public final class WSHandlerConstants {
      * Defines which key identifier type to use for encryption. The WS-Security specifications
      * recommends to use the identifier type <code>IssuerSerial</code>. For
      * possible encryption key identifier types refer to
-     * {@link #keyIdentifier}. For encryption <code>IssuerSerial</code>,
-     * <code>X509KeyIdentifier</code>,  <code>DirectReference</code>, 
-     * <code>Thumbprint</code>, <code>SKIKeyIdentifier</code>, and
-     * <code>EmbeddedKeyName</code> are valid only.
+     * {@link #getKeyIdentifier(String)}. For encryption <code>IssuerSerial</code>,
+     * <code>DirectReference</code>, <code>X509KeyIdentifier</code>, 
+     * <code>Thumbprint</code>, <code>SKIKeyIdentifier</code>, <code>EncryptedKeySHA1</code>
+     * and <code>EmbeddedKeyName</code> are valid only.
+     * <p/>
+     * The default is <code>IssuerSerial</code>.
      * <p/>
      * The application may set this parameter using the following method:
      * <pre>
@@ -826,10 +831,22 @@ public final class WSHandlerConstants {
                 Integer.valueOf(WSConstants.THUMBPRINT_IDENTIFIER));
         keyIdentifier.put("EncryptedKeySHA1",
                 Integer.valueOf(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER));
+        keyIdentifier.put("KeyValue",
+                Integer.valueOf(WSConstants.KEY_VALUE));
     }
     
     /**
-     * Get the key identifier type corresponding to the parameter
+     * Get the key identifier type corresponding to the parameter. This is intended for internal
+     * use only. Valid values for "parameter" are:
+     *  - "IssuerSerial"
+     *  - "DirectReference"
+     *  - "X509KeyIdentifier"
+     *  - "Thumbprint"
+     *  - "SKIKeyIdentifier"
+     *  - "KeyValue"
+     *  - "EmbeddedKeyName"
+     *  - "EncryptedKeySHA1"
+     * 
      * @param parameter
      * @return the key identifier type corresponding to the parameter
      */

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java?rev=1455889&r1=1455888&r2=1455889&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java Wed Mar 13 11:26:18 2013
@@ -85,7 +85,9 @@ public class WSSecBase {
      * @see WSConstants#ISSUER_SERIAL
      * @see WSConstants#BST_DIRECT_REFERENCE
      * @see WSConstants#X509_KEY_IDENTIFIER
+     * @see WSConstants#THUMBPRINT_IDENTIFIER
      * @see WSConstants#SKI_KEY_IDENTIFIER
+     * @see WSConstants#KEY_VALUE
      */
     public void setKeyIdentifierType(int keyIdType) {
         keyIdentifierType = keyIdType;