[WSS4J] wss4j/src/org/apache/ws/security/message WSEncryptBody.java,1.24,1.25
[email protected] Sat, 10 Jan 2004 05:11:20 -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-serv9055/src/org/apache/ws/security/message
Modified Files:
WSEncryptBody.java
Log Message:
support to specify a C14n serialization for encryption (only setter
method yet, XMLCiphercall must be enhanced too, need to synchronize
with xmlsec development).
Index: WSEncryptBody.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message/WSEncryptBody.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** WSEncryptBody.java 22 Dec 2003 15:31:04 -0000 1.24
--- WSEncryptBody.java 10 Jan 2004 13:11:18 -0000 1.25
***************
*** 90,93 ****
--- 90,94 ----
protected String symEncAlgo = WSConstants.TRIPLE_DES;
protected String keyTransportAlgo = WSConstants.KEYTRANSPORT_RSA15;
+ protected String encCanonAlgo = null;
protected byte[] embeddedKey = null;
***************
*** 163,166 ****
--- 164,185 ----
/**
+ * Set the name of an optional canonicalization algorithm to use
+ * before encryption
+ * <p/>
+ * This c14n alogrithm is used to serialize the data before
+ * encryption, i.e. the SOAP Body. If the algorithm
+ * is not set then a standard serialization is used (provided
+ * by XMLCipher, usually a XMLSerializer according to DOM 3
+ * specification).
+ * <p/>
+ *
+ * @param algo Is the name of the canonicalization algorithm
+ */
+ public void setEncCanonicalization(String algo) {
+ encCanonAlgo = algo;
+ }
+
+
+ /**
* Get the name of symmetric encryption algorithm to use
* <p/>
***************
*** 246,250 ****
KeyGenerator keyGen = getKeyGenerator();
symmetricKey = keyGen.generateKey();
! XMLCipher xmlCipher = XMLCipher.getInstance(symEncAlgo);
xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey);
--- 265,269 ----
KeyGenerator keyGen = getKeyGenerator();
symmetricKey = keyGen.generateKey();
! XMLCipher xmlCipher = XMLCipher.getInstance(symEncAlgo/*, encCanonAlgo */);
xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey);
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html