[WSS4J] wss4j/src/org/apache/ws/security WSConstants.java,1.13,1.14 WSSecurityEngine.java,1.35,1.36

[email protected] Fri, 13 Feb 2004 08:11:07 -0800
Newsgroups gmane.text.xml.wss4j
Message-ID <[email protected]>
Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/security
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10700/src/org/apache/ws/security

Modified Files:
	WSConstants.java WSSecurityEngine.java 
Log Message:
Add some functions to support SKI KeyIdentifier. Not tested yet, but
doesn't break existing functions.

Index: WSConstants.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/WSConstants.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- WSConstants.java	10 Feb 2004 15:22:19 -0000	1.13
+++ WSConstants.java	13 Feb 2004 16:11:04 -0000	1.14
@@ -243,9 +243,25 @@
      * the signing certificate.   
      * <p/>
      * Refer to WS Security specification X509 profile, chapter 3.3.1
-     * This identification token is not yet supported by WSS4J
+     * This identification token is not yet supported by WSS4J. The
+     * WsDoAllSender does not include the X.509 certificate as
+     * <code>BinarySecurityToken</code> in the request message.
      */
-    public static final int SKI_KEY_IDENTIFIER = 4;
+	public static final int SKI_KEY_IDENTIFIER = 4;
+	/**
+	 * Sets the 
+	 * {@link org.apache.ws.security.message.WSSignEnvelope#build(Document, Crypto)
+	 *  signing}
+	 * method to send a <code>SubjectKeyIdentifier</code> to identify
+	 * the signing certificate.   
+	 * <p/>
+	 * Refer to WS Security specification X509 profile, chapter 3.3.1
+	 * This identification token is not yet supported by WSS4J.
+	 * This option orders the WsDoAllSender to include the X.509
+	 * certificate as a <code>BinarySecurityToken</code> 
+	 * in the request message.
+	 */
+	public static final int SKI_KEY_IDENTIFIER_DIRECT = 6;
         
 	/**
 	 * Embeds a keyinfo/key name into the EncryptedData element.  

Index: WSSecurityEngine.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/WSSecurityEngine.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- WSSecurityEngine.java	10 Feb 2004 15:22:19 -0000	1.35
+++ WSSecurityEngine.java	13 Feb 2004 16:11:04 -0000	1.36
@@ -485,7 +485,7 @@
                 }
                 certs = crypto.getCertificates(alias);
             } else if (secRef.containsKeyIdentifier()) {
-				BinarySecurity token = secRef.getKeyIdentifier();
+				BinarySecurity token = secRef.getKeyIdentifier(crypto);
 				if (!(token instanceof X509Security)) {
 					throw new 
 						WSSecurityException(
@@ -825,7 +825,7 @@
          * This method is _not_recommended by OASIS WS-S specification, X509 profile
          */
 		else if (secRef.containsKeyIdentifier()) {
-            BinarySecurity token = secRef.getKeyIdentifier();
+            BinarySecurity token = secRef.getKeyIdentifier(crypto);
             if (!(token instanceof X509Security)) {
                 throw new WSSecurityException(WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
                         "unsupportedBinaryTokenType", new Object[]{"for decryption"});



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click