[WSS4J] wss4j/src/org/apache/ws/security/message WSEncryptBody.java,1.25,1.26
[email protected] Fri, 16 Jan 2004 07:24:04 -0800
| Newsgroups | gmane.text.xml.wss4j |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message
In directory sc8-pr-cvs1:/tmp/cvs-serv26235/src/org/apache/ws/security/message
Modified Files:
WSEncryptBody.java
Log Message:
Add support for STR-Transform, add new STR Reference type for
encryption
Index: WSEncryptBody.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message/WSEncryptBody.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** WSEncryptBody.java 10 Jan 2004 13:11:18 -0000 1.25
--- WSEncryptBody.java 16 Jan 2004 15:24:02 -0000 1.26
***************
*** 61,66 ****
--- 61,70 ----
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.components.crypto.Crypto;
+ import org.apache.ws.security.message.token.BinarySecurity;
import org.apache.ws.security.message.token.SecurityTokenReference;
+ import org.apache.ws.security.message.token.X509Security;
import org.apache.ws.security.util.WSSecurityUtil;
+ import org.apache.ws.security.message.token.Reference;
+
import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
***************
*** 376,379 ****
--- 380,397 ----
secToken.setX509IssuerSerial(
new XMLX509IssuerSerial(doc, remoteCert));
+ } else if (keyIdentifierType == WSConstants.BST_DIRECT_REFERENCE) {
+ Reference ref = new Reference(doc);
+ String certUri = "id-" + remoteCert.hashCode();
+ ref.setURI("#" + certUri);
+ secToken.setReference(ref);
+ BinarySecurity token = null;
+ token = new X509Security(doc);
+ ((X509Security) token).setX509Certificate(remoteCert);
+ token.setID(certUri);
+ WSSecurityUtil.prependChildElement(
+ doc,
+ wsseSecurity,
+ token.getElement(),
+ false);
}
else {
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn