Author: ruchithf
Date: Tue Sep 12 13:52:18 2006
New Revision: 442698
URL: http://svn.apache.org/viewvc?view=rev&rev=442698
Log:
Options to set the key identifier externally to support cases where we have to
encrypt using an external key. In this we don't have to call the prepare method
to setup anything. Therefore we have to be able to set the Document
externally as well.
Modified:
webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java
Modified:
webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java?view=diff&rev=442698&r1=442697&r2=442698
==============================================================================
---
webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java
(original)
+++
webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java
Tue Sep 12 13:52:18 2006
@@ -228,7 +228,9 @@
* session key
*/
encryptedKeyElement = createEnrcyptedKey(document, keyEncAlgo);
- this.encKeyId = "EncKeyId-" + encryptedKeyElement.hashCode();
+ if(this.encKeyId == null || "".equals(this.encKeyId)) {
+ this.encKeyId = "EncKeyId-" + encryptedKeyElement.hashCode();
+ }
encryptedKeyElement.setAttributeNS(null, "Id", this.encKeyId);
KeyInfo keyInfo = new KeyInfo(document);
@@ -473,4 +475,20 @@
return this.bstToken.getID();
}
+
+ /**
+ * @param document The document to set.
+ */
+ public void setDocument(Document document) {
+ this.document = document;
+ }
+
+ /**
+ * @param encKeyId The encKeyId to set.
+ */
+ public void setEncKeyId(String encKeyId) {
+ this.encKeyId = encKeyId;
+ }
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]