You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by we...@apache.org on 2006/03/06 14:50:23 UTC

svn commit: r383538 - in /webservices/wss4j/trunk/src/org/apache/ws/security: message/ saml/

Author: werner
Date: Mon Mar  6 05:50:15 2006
New Revision: 383538

URL: http://svn.apache.org/viewcvs?rev=383538&view=rev
Log:
Set these classes and their methods as depreceated.

Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java
    webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSignSAMLEnvelope.java

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java Mon Mar  6 05:50:15 2006
@@ -40,6 +40,8 @@
 
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
      */
     public WSAddSignatureConfirmation() {
     }
@@ -50,6 +52,9 @@
      * @param actor
      *            the name of the actor of the <code>wsse:Security</code>
      *            header
+     * 
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
+     *             and {@link WSSecHeader} for actor specification.
      */
     public WSAddSignatureConfirmation(String actor) {
         super(actor);
@@ -63,6 +68,10 @@
      *            header
      * @param mu
      *            Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
+     *             and {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSAddSignatureConfirmation(String actor, boolean mu) {
         super(actor, mu);
@@ -80,6 +89,9 @@
      *            the Signature value. This will be the content of the "Value"
      *            attribute.
      * @return Document with SignatureConfirmation added
+     * 
+     * @deprecated replaced by
+     *             {@link WSSecSignatureConfirmation#build(Document, byte[], WSSecHeader)}
      */
     public Document build(Document doc, byte[] sigVal) {
         log.debug("Begin add signature confirmation...");
@@ -98,6 +110,9 @@
      * Set the wsu:Id value of the SignatureConfirmation
      * 
      * @param id
+     * 
+     * @deprecated no replacement, id is created by default in
+     *             {@link WSSecSignatureConfirmation}
      */
     public void setId(String id) {
         this.id = id;
@@ -107,6 +122,8 @@
      * Get the wsu:Id value of the SignatureConfirmation
      * 
      * @return Returns the wsu:id value
+     * 
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#getId()}
      */
     public String getId() {
         return id;

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java Mon Mar  6 05:50:15 2006
@@ -40,6 +40,8 @@
 
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecTimestamp#constructor()}
      */
     public WSAddTimestamp() {
     }
@@ -50,6 +52,9 @@
      * @param actor
      *            the name of the actor of the <code>wsse:Security</code>
      *            header
+     * 
+     * @deprecated replaced by {@link WSSecTimestamp#constructor()} and
+     *             {@link WSSecHeader} for actor specification.
      */
     public WSAddTimestamp(String actor) {
         super(actor);
@@ -63,6 +68,9 @@
      *            header
      * @param mu
      *            Set <code>mustUnderstand</code> to true or false
+     * @deprecated replaced by {@link WSSecTimestamp#constructor()} and
+     *             {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSAddTimestamp(String actor, boolean mu) {
         super(actor, mu);
@@ -83,6 +91,9 @@
      *            should not be added.
      * @return Document with Timestamp added
      * @throws Exception
+     * @deprecated replaced by
+     *             {@link WSSecTimestamp#build(Document, WSSecHeader)} and
+     *             {@link WSSecTimestamp#setTimeToLive()}
      */
     public Document build(Document doc, int ttl) {
         log.debug("Begin add timestamp...");
@@ -100,6 +111,8 @@
      * Set the wsu:Id value of the Timestamp
      * 
      * @param id
+     * @deprecated no replacement, id is created by default in
+     *             {@link WSSecTimestamp}
      */
     public void setId(String id) {
         this.id = id;
@@ -111,6 +124,8 @@
      * Get the wsu:Id value of the Timestamp
      * 
      * @return TODO
+     *
+     * @deprecated replaced by {@link WSSecTimestamp#getId()}
      */
     public String getId() {
         return id;

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java Mon Mar  6 05:50:15 2006
@@ -30,49 +30,64 @@
 import java.util.Vector;
 
 /**
- * This is the base class for WS Security messages.
- * It provides common functions and fields used by the specific message
- * classes such as sign, encrypt, and username token.
- *
+ * This is the base class for WS Security messages. It provides common functions
+ * and fields used by the specific message classes such as sign, encrypt, and
+ * username token.
+ * 
  * @author Werner Dittmann (Werner.Dittmann@t-online.de)
  */
 public class WSBaseMessage {
     private static Log log = LogFactory.getLog(WSBaseMessage.class.getName());
+
     protected String actor = null;
+
     protected boolean mustunderstand = true;
+
     protected String user = null;
+
     protected String password = null;
+
     protected int keyIdentifierType = WSConstants.ISSUER_SERIAL;
+
     protected Vector parts = null;
+
     protected int timeToLive = 300; // time between Created and Expires
 
     protected boolean doDebug = false;
 
     protected WSSConfig wssConfig = WSSConfig.getDefaultWSConfig();
 
-
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecBase#constructor()}
      */
     public WSBaseMessage() {
     }
 
     /**
-     * Constructor.
-     * <p/>
-     *
-     * @param actor The actor name of the <code>wsse:Security</code> header
+     * Constructor. <p/>
+     * 
+     * @param actor
+     *            The actor name of the <code>wsse:Security</code> header
+     * @deprecated replaced by {@link WSSecBase#constructor()} and
+     *             {@link WSSecHeader} for actor specification.
      */
     public WSBaseMessage(String actor) {
         this(actor, true);
     }
 
     /**
-     * Constructor.
-     * <p/>
-     *
-     * @param actor The actor name of the <code>wsse:Security</code> header
-     * @param mu    Set <code>mustUnderstand</code> to true or false
+     * Constructor. <p/>
+     * 
+     * @param actor
+     *            The actor name of the <code>wsse:Security</code> header
+     * @param mu
+     *            Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecBase#constructor()} and
+     *             {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSBaseMessage(String actor, boolean mu) {
         setActor(actor);
@@ -80,32 +95,35 @@
     }
 
     /**
-     * set actor name.
-     * <p/>
-     *
-     * @param act The actor name of the <code>wsse:Security</code> header
+     * set actor name. <p/>
+     * 
+     * @param act
+     *            The actor name of the <code>wsse:Security</code> header
+     * @deprecated replaced by {@link WSSecHeader#setActor(String)}
      */
     public void setActor(String act) {
         actor = act;
     }
 
     /**
-     * Set the time to live.
-     * This is the time difference in seconds between the <code>Created</code>
-     * and the <code>Expires</code> in <code>Timestamp</code>.
-     * <p/>
-     *
-     * @param ttl The time to live in second
+     * Set the time to live. This is the time difference in seconds between the
+     * <code>Created</code> and the <code>Expires</code> in
+     * <code>Timestamp</code>. <p/>
+     * 
+     * @param ttl
+     *            The time to live in second
+     * @deprecated replaced by {@link WSSecTimestamp#setTimeToLive(int)}
      */
     public void setTimeToLive(int ttl) {
         timeToLive = ttl;
     }
 
     /**
-     * Set which parts of the message to encrypt/sign.
-     * <p/>
-     *
-     * @param parts The vector containing the WSEncryptionPart objects
+     * Set which parts of the message to encrypt/sign. <p/>
+     * 
+     * @param parts
+     *            The vector containing the WSEncryptionPart objects
+     * @deprecated replaced by {@link WSSecBase#setParts(Vector)}
      */
     public void setParts(Vector parts) {
         this.parts = parts;
@@ -114,26 +132,27 @@
     /**
      * Set the <code>mustUnderstand</code> flag for the
      * <code>wsse:Security</code> header
-     *
-     * @param mu Set <code>mustUnderstand</code> to true or false
+     * 
+     * @param mu
+     *            Set <code>mustUnderstand</code> to true or false
+     * @deprecated replaced by {@link WSSecHeader#setMustUnderstand(boolean)}
      */
     public void setMustUnderstand(boolean mu) {
         mustunderstand = mu;
     }
 
     /**
-     * Sets which key identifier to use.
-     * <p/>
-     * Defines the key identifier type to use in the
-     * {@link WSSignEnvelope#build(Document, Crypto) signature} or the
-     * {@link WSEncryptBody#build(Document, Crypto) ecnryption}
-     * function to set up the key identification elements.
-     *
+     * Sets which key identifier to use. <p/> Defines the key identifier type to
+     * use in the {@link WSSignEnvelope#build(Document, Crypto) signature} or
+     * the {@link WSEncryptBody#build(Document, Crypto) ecnryption} function to
+     * set up the key identification elements.
+     * 
      * @param keyIdType
      * @see WSConstants#ISSUER_SERIAL
      * @see WSConstants#BST_DIRECT_REFERENCE
      * @see WSConstants#X509_KEY_IDENTIFIER
      * @see WSConstants#SKI_KEY_IDENTIFIER
+     * @deprecated replaced by {@link WSSecBase#setKeyIdentifierType(int)}
      */
     public void setKeyIdentifierType(int keyIdType) {
         keyIdentifierType = keyIdType;
@@ -141,44 +160,45 @@
 
     /**
      * Gets the value of the <code>keyIdentifyerType</code>.
-     *
+     * 
      * @return The <code>keyIdentifyerType</code>.
      * @see WSConstants#ISSUER_SERIAL
      * @see WSConstants#BST_DIRECT_REFERENCE
      * @see WSConstants#X509_KEY_IDENTIFIER
      * @see WSConstants#SKI_KEY_IDENTIFIER
+     * @deprecated replaced by {@link WSSecBase#getKeyIdentifierType()}
      */
     public int getKeyIdentifierType() {
         return keyIdentifierType;
     }
 
     /**
-     * @param wsConfig The wsConfig to set.
+     * @param wsConfig
+     *            The wsConfig to set.
+     * @deprecated replaced by {@link WSSecBase#setWsConfig(WSSConfig)}
      */
     public void setWsConfig(WSSConfig wsConfig) {
         this.wssConfig = wsConfig;
     }
 
     /**
-     * Looks up or adds a body id.
-     * <p/>
-     * First try to locate the <code>wsu:Id</code> in the SOAP body element.
-     * If one is found, the value of the <code>wsu:Id</code> attribute is returned.
-     * Otherwise the methode generates a new <code>wsu:Id</code> and an
-     * appropriate value.
-     *
-     * @param doc The SOAP envelope as <code>Document</code>
-     * @return The value of the <code>wsu:Id</code> attribute
-     *         of the SOAP body
+     * Looks up or adds a body id. <p/> First try to locate the
+     * <code>wsu:Id</code> in the SOAP body element. If one is found, the
+     * value of the <code>wsu:Id</code> attribute is returned. Otherwise the
+     * methode generates a new <code>wsu:Id</code> and an appropriate value.
+     * 
+     * @param doc
+     *            The SOAP envelope as <code>Document</code>
+     * @return The value of the <code>wsu:Id</code> attribute of the SOAP body
      * @throws Exception
+     * @deprecated replaced by {@link WSSecBase#setBodyID(Document)}
      */
     protected String setBodyID(Document doc) throws Exception {
-        SOAPConstants soapConstants =
-                WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
-        Element bodyElement =
-                (Element) WSSecurityUtil.getDirectChild(doc.getFirstChild(),
-                        soapConstants.getBodyQName().getLocalPart(),
-                        soapConstants.getEnvelopeURI());
+        SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(doc
+                .getDocumentElement());
+        Element bodyElement = (Element) WSSecurityUtil.getDirectChild(doc
+                .getFirstChild(), soapConstants.getBodyQName().getLocalPart(),
+                soapConstants.getEnvelopeURI());
         if (bodyElement == null) {
             throw new Exception("SOAP Body Element node not found");
         }
@@ -191,24 +211,24 @@
 
         if ((id == null) || (id.length() == 0)) {
             id = "id-" + Integer.toString(bodyElement.hashCode());
-            String prefix =
-                WSSecurityUtil.setNamespace(bodyElement,
-                        WSConstants.WSU_NS,
-                        WSConstants.WSU_PREFIX);
+            String prefix = WSSecurityUtil.setNamespace(bodyElement,
+                    WSConstants.WSU_NS, WSConstants.WSU_PREFIX);
             bodyElement.setAttributeNS(WSConstants.WSU_NS, prefix + ":Id", id);
         }
         return id;
     }
 
     /**
-     * Set the user and password info.
-     * <p/>
-     * Both information is used to get the user's private signing key.
-     *
-     * @param user     This is the user's alias name in the keystore that
-     *                 identifies the private key to sign the document
-     * @param password The user's password to get the private signing key
-     *                 from the keystore
+     * Set the user and password info. <p/> Both information is used to get the
+     * user's private signing key.
+     * 
+     * @param user
+     *            This is the user's alias name in the keystore that identifies
+     *            the private key to sign the document
+     * @param password
+     *            The user's password to get the private signing key from the
+     *            keystore
+     * @deprecated replaced by {@link WSSecBase#setUserInfo(String, String)}
      */
     public void setUserInfo(String user, String password) {
         this.user = user;
@@ -217,37 +237,36 @@
 
     /**
      * Creates a security header and inserts it as child into the SOAP Envelope.
-     * <p/>
-     * Check if a WS Security header block for an actor is already available
-     * in the document. If a header block is found return it, otherwise a new
-     * wsse:Security header block is created and the attributes set
-     *
-     * @param doc A SOAP envelope as <code>Document</code>
+     * <p/> Check if a WS Security header block for an actor is already
+     * available in the document. If a header block is found return it,
+     * otherwise a new wsse:Security header block is created and the attributes
+     * set
+     * 
+     * @param doc
+     *            A SOAP envelope as <code>Document</code>
      * @return A <code>wsse:Security</code> element
+     * @deprecated replaced by
+     *             {@link WSSecHeader#insertSecurityHeader(Document)}
      */
     protected Element insertSecurityHeader(Document doc) {
-        SOAPConstants soapConstants =
-                WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
+        SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(doc
+                .getDocumentElement());
         // lookup a security header block that matches actor
-        Element securityHeader =
-                WSSecurityUtil.getSecurityHeader(doc, actor, soapConstants);
+        Element securityHeader = WSSecurityUtil.getSecurityHeader(doc, actor,
+                soapConstants);
         if (securityHeader == null) { // create if nothing found
-            securityHeader =
-                    WSSecurityUtil.findWsseSecurityHeaderBlock(doc,
-                            doc.getDocumentElement(),
-                            actor,
-                            true);
-
-            String soapPrefix =
-                    WSSecurityUtil.getPrefixNS(soapConstants.getEnvelopeURI(),
-                            securityHeader);
+            securityHeader = WSSecurityUtil.findWsseSecurityHeaderBlock(doc,
+                    doc.getDocumentElement(), actor, true);
+
+            String soapPrefix = WSSecurityUtil.getPrefixNS(soapConstants
+                    .getEnvelopeURI(), securityHeader);
             if (actor != null && actor.length() > 0) {
                 // Check for SOAP 1.2 here and use "role" instead of "actor"
                 securityHeader.setAttributeNS(soapConstants.getEnvelopeURI(),
                         soapPrefix
-                        + ":"
-                        + soapConstants.getRoleAttributeQName().getLocalPart(),
-                        actor);
+                                + ":"
+                                + soapConstants.getRoleAttributeQName()
+                                        .getLocalPart(), actor);
             }
             if (mustunderstand) {
                 securityHeader.setAttributeNS(soapConstants.getEnvelopeURI(),

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java Mon Mar  6 05:50:15 2006
@@ -91,7 +91,8 @@
 
     /**
      * Constructor.
-     */
+     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+    */
     public WSEncryptBody() {
     }
 
@@ -101,6 +102,9 @@
      *
      * @param actor The actor name of the <code>wsse:Security</code>
      *              header
+     * 
+     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+     *             and {@link WSSecHeader} for actor specification.
      */
     public WSEncryptBody(String actor) {
         super(actor);
@@ -112,6 +116,10 @@
      *
      * @param actor The actor name of the <code>wsse:Security</code> header
      * @param mu    Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+     *             and {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSEncryptBody(String actor, boolean mu) {
         super(actor, mu);
@@ -123,6 +131,8 @@
      *
      * @param key to use during encryption. The key must fit the
      *            selected symmetrical encryption algorithm
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setKey(byte[])}
      */
     public void setKey(byte[] key) {
         this.embeddedKey = key;
@@ -137,6 +147,8 @@
      * @param keyEnc specifies the key encoding algorithm.
      * @see WSConstants#KEYTRANSPORT_RSA15
      * @see WSConstants#KEYTRANSPORT_RSAOEP
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setKeyEnc(String)}
      */
     public void setKeyEnc(String keyEnc) {
         keyEncAlgo = keyEnc;
@@ -149,6 +161,8 @@
      * <p/>
      *
      * @param user
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setUserInfo(String)}
      */
     public void setUserInfo(String user) {
         this.user = user;
@@ -158,6 +172,8 @@
      * Set the key name for EMBEDDED_KEYNAME
      *
      * @param embeddedKeyName
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setEmbeddedKeyName(String)}
      */
     public void setEmbeddedKeyName(String embeddedKeyName) {
         this.embeddedKeyName = embeddedKeyName;
@@ -170,6 +186,8 @@
      * to get the public key for encryption.
      *
      * @param cert is the X509 certificate to use for encryption
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setUseThisCert(X509Certificate)}
      */
     public void setUseThisCert(X509Certificate cert) {
         useThisCert = cert;
@@ -189,6 +207,8 @@
      * @see WSConstants#AES_128
      * @see WSConstants#AES_192
      * @see WSConstants#AES_256
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setSymmetricEncAlgorithm(String)}
      */
     public void setSymmetricEncAlgorithm(String algo) {
         symEncAlgo = algo;
@@ -206,6 +226,8 @@
      * <p/>
      *
      * @param algo Is the name of the canonicalization algorithm
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setEncCanonicalization(String)}
      */
     public void setEncCanonicalization(String algo) {
         encCanonAlgo = algo;
@@ -225,6 +247,8 @@
      * @see WSConstants#AES_128
      * @see WSConstants#AES_192
      * @see WSConstants#AES_256
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#getSymmetricEncAlgorithm()}
      */
     public String getSymmetricEncAlgorithm() {
         return symEncAlgo;
@@ -263,6 +287,8 @@
      * @return the SOAP envelope with encrypted Body as <code>Document
      *         </code>
      * @throws WSSecurityException
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#build(Document, Crypto, WSSecHeader)}
      */
     public Document build(Document doc, Crypto crypto) throws WSSecurityException {
         doDebug = log.isDebugEnabled();
@@ -446,13 +472,13 @@
         return doc;
     }
 
-    private Vector doEncryption(Document doc, SecretKey encryptionKey)
+    private Vector doEncryption(Document doc, SecretKey encryptKey)
         throws WSSecurityException {
-        return doEncryption(doc, encryptionKey, null);
+        return doEncryption(doc, encryptKey, null);
     }
 
     private Vector doEncryption(Document doc,
-                                SecretKey encryptionKey,
+                                SecretKey encryptKey,
                                 KeyInfo keyInfo)
             throws WSSecurityException {
         /*
@@ -516,7 +542,7 @@
              * xenc:EncryptedData
              */
             try {
-                xmlCipher.init(XMLCipher.ENCRYPT_MODE, encryptionKey);
+                xmlCipher.init(XMLCipher.ENCRYPT_MODE, encryptKey);
                 EncryptedData encData = xmlCipher.getEncryptedData();
                 encData.setId(xencEncryptedDataId);
                 encData.setKeyInfo(keyInfo);
@@ -707,6 +733,8 @@
      * Sets the parent node of the EncryptedKeyElement
      *
      * @param element
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setParentNode(Element)}
      */
     public void setParentNode(Element element) {
         parentNode = element;
@@ -714,6 +742,8 @@
 
     /**
      * @return TODO
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#getSymmetricKey()}
      */
     public SecretKey getSymmetricKey() {
         return symmetricKey;
@@ -722,6 +752,8 @@
     /**
      * Set the symmetric key to be used for encryption
      * @param key
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setSymmetricKey(SecretKey)}
      */
     public void setSymmetricKey(SecretKey key) {
         this.symmetricKey = key;
@@ -732,6 +764,8 @@
      * the symmetric key field.
      *
      * @return The symmetric key
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#getEncryptionKey()}
      */
     public SecretKey getEncryptionKey() {
         return this.encryptionKey;
@@ -739,6 +773,8 @@
 
     /**
      * @return TODO
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#getSecurityTokenReference()}
      */
     public SecurityTokenReference getSecurityTokenReference() {
         return securityTokenReference;
@@ -746,6 +782,8 @@
 
     /**
      * @param reference
+     * @deprecated replaced by
+     *             {@link WSSecEncrypt#setSecurityTokenReference(SecurityTokenReference)}
      */
     public void setSecurityTokenReference(SecurityTokenReference reference) {
         securityTokenReference = reference;

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java Mon Mar  6 05:50:15 2006
@@ -36,6 +36,8 @@
 
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
      */
     public WSSAddSAMLToken() {
     }
@@ -46,6 +48,8 @@
      *
      * @param actor the name of the actor of the <code>wsse:Security</code>
      *              header
+     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
+     *             and {@link WSSecHeader} for actor specification.
      */
     public WSSAddSAMLToken(String actor) {
         super(actor);
@@ -58,6 +62,10 @@
      * @param actor The name of the actor of the <code>wsse:Security</code>
      *              header
      * @param mu    Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
+     *             and {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSSAddSAMLToken(String actor, boolean mu) {
         super(actor, mu);
@@ -72,6 +80,7 @@
      * @param doc      The SOAP enevlope as W3C document
      * @param assertion TODO
      * @return Document with UsernameToken added
+     * @deprecated replaced by {@link WSSecSAMLToken#build(Document, SAMLAssertion, WSSecHeader)}
      */
     public Document build(Document doc, SAMLAssertion assertion) {
         log.debug("Begin add SAMLAssertion token...");

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java Mon Mar  6 05:50:15 2006
@@ -41,6 +41,8 @@
     
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
      */
     public WSSAddUsernameToken() {
     }
@@ -50,6 +52,8 @@
      * <p/>
      *
      * @param actor the name of the actor of the <code>wsse:Security</code> header
+     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
+     *             and {@link WSSecHeader} for actor specification.
      */
     public WSSAddUsernameToken(String actor) {
         super(actor);
@@ -61,6 +65,9 @@
      *
      * @param actor The name of the actor of the <code>wsse:Security</code> header
      * @param mu    Set <code>mustUnderstand</code> to true or false
+     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
+     *             and {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSSAddUsernameToken(String actor, boolean mu) {
         super(actor, mu);
@@ -73,6 +80,7 @@
      * @param pwType contains the password type. Only allowed values are
      *               {@link WSConstants#PASSWORD_DIGEST} and
      *               {@link WSConstants#PASSWORD_TEXT}.
+     * @deprecated replaced by {@link WSSecUsernameToken#setPasswordType(String)}
      */
     public void setPasswordType(String pwType) {
         if (pwType == null) {
@@ -83,14 +91,16 @@
     }
 
     /**
-     * Creates and adds a Nonce element to the UsernameToken
+     * Creates and adds a Nonce element to the UsernameToken.
+     * @deprecated replaced by {@link WSSecUsernameToken#addNonce()}
      */
     public void addNonce(Document doc) {
         ut.addNonce(doc);
     }
 
     /**
-     * Creates and adds a Created element to the UsernameToken
+     * Creates and adds a Created element to the UsernameToken.
+     * @deprecated replaced by {@link WSSecUsernameToken#addCreated()}
      */
     public void addCreated(Document doc) {
         ut.addCreated(wssConfig.isPrecisionInMilliSeconds(), doc);
@@ -99,6 +109,8 @@
     /**
      * set the id
      * @param id
+     * @deprecated no replacement, id is created by default in
+     *             {@link WSSecUsernameToken}
      */ 
     public void setId(String id) {
         this.id = id;
@@ -106,12 +118,18 @@
             ut.setID(id);
     }
 
+    /**
+     * Get a secret key derived from values in UsernameToken.
+     * @return
+     * @deprecated replaced by {@link WSSecUsernameToken#getSecretKey()}
+     */
     public byte[] getSecretKey() {
     	return ut.getSecretKey();
     }
     /**
      * get the id
-     * @return TODO
+     * @return The id
+     * @deprecated replaced by {@link WSSecUsernameToken#getId()}
      */ 
     public String getId() {
         return id;
@@ -133,6 +151,9 @@
      * @param username The username to set in the UsernameToken
      * @param password The password of the user
      * @return Document with UsernameToken added
+     * @deprecated replaced by
+     *             {@link WSSecUsernameToken#build(Document, WSSecHeader)} and
+     *             {@link WSSecBase#setUserInfo(String, String)}
      */
     public Document build(Document doc, String username, String password) { // throws Exception {
         log.debug("Begin add username token...");

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java Mon Mar  6 05:50:15 2006
@@ -82,6 +82,7 @@
 
     /**
      * Constructor.
+     * @deprecated replaced by {@link WSSecSignature#constructor()}
      */
     public WSSignEnvelope() {
     }
@@ -90,6 +91,9 @@
      * Constructor.
      *
      * @param actor The actor name of the <code>wsse:Security</code> header
+     * 
+     * @deprecated replaced by {@link WSSecSignature#constructor()}
+     *             and {@link WSSecHeader} for actor specification.
      */
     public WSSignEnvelope(String actor) {
         super(actor);
@@ -100,6 +104,10 @@
      *
      * @param actor The actor name of the <code>wsse:Security</code> header
      * @param mu    Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecSignature#constructor()}
+     *             and {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSSignEnvelope(String actor, boolean mu) {
         super(actor, mu);
@@ -109,6 +117,7 @@
      * set the single cert flag.
      *
      * @param useSingleCert
+     * @deprecated replaced by {@link WSSecSignature#setUseSingleCertificate(boolean)}
      */
     public void setUseSingleCertificate(boolean useSingleCert) {
         this.useSingleCert = useSingleCert;
@@ -117,7 +126,8 @@
     /**
      * Get the single cert flag.
      *
-     * @return TODO
+     * @return If to use a single cert
+     * @deprecated replaced by {@link WSSecSignature#isUseSingleCertificate()}
      */
     public boolean isUseSingleCertificate() {
         return this.useSingleCert;
@@ -133,6 +143,7 @@
      *            Is the name of the signature algorithm
      * @see WSConstants#RSA
      * @see WSConstants#DSA
+     * @deprecated replaced by {@link WSSecSignature#setSignatureAlgorithm(String)}
      */
     public void setSignatureAlgorithm(String algo) {
         sigAlgo = algo;
@@ -144,6 +155,7 @@
      * If the algorithm is not set then RSA is default.
      *
      * @return the identifier URI of the signature algorithm
+     * @deprecated replaced by {@link WSSecSignature#getSignatureAlgorithm()}
      */
     public String getSignatureAlgorithm() {
         return sigAlgo;
@@ -162,6 +174,7 @@
      * @see WSConstants#C14N_WITH_COMMENTS
      * @see WSConstants#C14N_EXCL_OMIT_COMMENTS
      * @see WSConstants#C14N_EXCL_WITH_COMMENTS
+     * @deprecated replaced by {@link WSSecSignature#setSigCanonicalization(String)}
      */
     public void setSigCanonicalization(String algo) {
         canonAlgo = algo;
@@ -174,6 +187,7 @@
      * Canonicalization is used by default.
      *
      * @return TODO
+     * @deprecated replaced by {@link WSSecSignature#getSigCanonicalization()}
      */
     public String getSigCanonicalization() {
         return canonAlgo;
@@ -181,6 +195,7 @@
 
     /**
      * @param usernameToken The usernameToken to set.
+     * @deprecated replaced by {@link WSSecSignature#setUsernameToken(WSSecUsernameToken)}
      */
     public void setUsernameToken(WSSAddUsernameToken usernameToken) {
         this.usernameToken = usernameToken;
@@ -188,6 +203,7 @@
 
     /**
      * @return Returns the signatureValue.
+     * @deprecated replaced by {@link WSSecSignature#getSignatureValue()}
      */
     public byte[] getSignatureValue() {
         return signatureValue;
@@ -206,6 +222,7 @@
      *               certificates
      * @return A signed SOAP envelope as <code>Document</code>
      * @throws WSSecurityException
+     * @deprecated replaced by {@link WSSecSignature#build(Document, Crypto, WSSecHeader)}
      */
     public Document build(Document doc, Crypto crypto)
             throws WSSecurityException {

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSignSAMLEnvelope.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSignSAMLEnvelope.java?rev=383538&r1=383537&r2=383538&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSignSAMLEnvelope.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSignSAMLEnvelope.java Mon Mar  6 05:50:15 2006
@@ -10,6 +10,7 @@
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.message.EnvelopeIdResolver;
+import org.apache.ws.security.message.WSSecHeader;
 import org.apache.ws.security.message.WSSignEnvelope;
 import org.apache.ws.security.message.token.BinarySecurity;
 import org.apache.ws.security.message.token.Reference;
@@ -39,45 +40,60 @@
 
 public class WSSignSAMLEnvelope extends WSSignEnvelope {
 
-    private static Log log = LogFactory.getLog(WSSignSAMLEnvelope.class.getName());
+    private static Log log = LogFactory.getLog(WSSignSAMLEnvelope.class
+            .getName());
 
     private static Log tlog = LogFactory.getLog("org.apache.ws.security.TIME");
 
-
     /**
      * Constructor.
+     * 
+     * @deprecated replaced by {@link WSSecSignatureSAML#constructor()}
      */
     public WSSignSAMLEnvelope() {
     }
 
     /**
      * Constructor.
-     *
-     * @param actor The actor name of the <code>wsse:Security</code> header
-     * @param mu    Set <code>mustUnderstand</code> to true or false
+     * 
+     * @param actor
+     *            The actor name of the <code>wsse:Security</code> header
+     * @param mu
+     *            Set <code>mustUnderstand</code> to true or false
+     * 
+     * @deprecated replaced by {@link WSSecSignatureSAML#constructor()} and
+     *             {@link WSSecHeader} for actor and mustunderstand
+     *             specification.
      */
     public WSSignSAMLEnvelope(String actor, boolean mu) {
         super(actor, mu);
     }
 
     /**
-     * Builds a signed soap envelope with SAML token. <p/>The method first
-     * gets an appropriate security header. According to the defined parameters
-     * for certificate handling the signature elements are constructed and
-     * inserted into the <code>wsse:Signature</code>
-     *
-     * @param doc           The unsigned SOAP envelope as <code>Document</code>
-     * @param assertion     the complete SAML assertion
-     * @param issuerCrypto  An instance of the Crypto API to handle keystore SAML token
-     *                      issuer and to generate certificates
-     * @param issuerKeyName Private key to use in case of "sender-Vouches"
-     * @param issuerKeyPW   Password for issuer private key
+     * Builds a signed soap envelope with SAML token. <p/>The method first gets
+     * an appropriate security header. According to the defined parameters for
+     * certificate handling the signature elements are constructed and inserted
+     * into the <code>wsse:Signature</code>
+     * 
+     * @param doc
+     *            The unsigned SOAP envelope as <code>Document</code>
+     * @param assertion
+     *            the complete SAML assertion
+     * @param issuerCrypto
+     *            An instance of the Crypto API to handle keystore SAML token
+     *            issuer and to generate certificates
+     * @param issuerKeyName
+     *            Private key to use in case of "sender-Vouches"
+     * @param issuerKeyPW
+     *            Password for issuer private key
      * @return A signed SOAP envelope as <code>Document</code>
      * @throws org.apache.ws.security.WSSecurityException
+     * @deprecated replaced by
+     *             {@link WSSecSignatureSAML#build(Document, Crypto, SAMLAssertion, Crypto, String, String, WSSecHeader)}
      */
     public Document build(Document doc, Crypto userCrypto,
-                          SAMLAssertion assertion, Crypto issuerCrypto, String issuerKeyName,
-                          String issuerKeyPW) throws WSSecurityException {
+            SAMLAssertion assertion, Crypto issuerCrypto, String issuerKeyName,
+            String issuerKeyPW) throws WSSecurityException {
 
         doDebug = log.isDebugEnabled();
 
@@ -89,10 +105,10 @@
             log.debug("Beginning ST signing...");
         }
         /*
-        * Get some information about the SAML token content. This controls how
-        * to deal with the whole stuff. First get the Authentication statement
-        * (includes Subject), then get the _first_ confirmation method only.
-        */
+         * Get some information about the SAML token content. This controls how
+         * to deal with the whole stuff. First get the Authentication statement
+         * (includes Subject), then get the _first_ confirmation method only.
+         */
         SAMLSubjectStatement samlSubjS = null;
         Iterator it = assertion.getStatements();
         while (it.hasNext()) {
@@ -121,9 +137,9 @@
             senderVouches = true;
         }
         /*
-        * Gather some info about the document to process and store it for
-        * retrival
-        */
+         * Gather some info about the document to process and store it for
+         * retrival
+         */
         WSDocInfo wsDocInfo = new WSDocInfo(doc.hashCode());
 
         Element envelope = doc.getDocumentElement();
@@ -137,12 +153,11 @@
             wsDocInfo.setCrypto(issuerCrypto);
         }
         /*
-        * in case of key holder:
-        * - get the user's certificate that _must_ be included in the SAML
-        * token. To ensure the cert integrity the SAML token must be signed
-        * (by the issuer). Just check if its signed, but
-        * don't verify this SAML token's signature here (maybe later).
-        */
+         * in case of key holder: - get the user's certificate that _must_ be
+         * included in the SAML token. To ensure the cert integrity the SAML
+         * token must be signed (by the issuer). Just check if its signed, but
+         * don't verify this SAML token's signature here (maybe later).
+         */
         else {
             if (userCrypto == null || assertion.isSigned() == false) {
                 throw new WSSecurityException(WSSecurityException.FAILURE,
@@ -165,7 +180,8 @@
                         certs[0] = cert;
                     }
                 }
-                // TODO: get alias name for cert, check against username set by caller
+                // TODO: get alias name for cert, check against username set by
+                // caller
             } catch (XMLSecurityException e3) {
                 throw new WSSecurityException(WSSecurityException.FAILURE,
                         "invalidSAMLsecurity",
@@ -225,14 +241,13 @@
         }
 
         /*
-        * If the sender vouches, then we must sign the SAML token _and_ at
-        * least one part of the message (usually the SOAP body). To do so we
-        * need to
-        * - put in a reference to the SAML token. Thus we create a STR
-        *   and insert it into the wsse:Security header
-        * - set a reference of the created STR to the signature and use STR
-        *   Transfrom during the signature
-        */
+         * If the sender vouches, then we must sign the SAML token _and_ at
+         * least one part of the message (usually the SOAP body). To do so we
+         * need to - put in a reference to the SAML token. Thus we create a STR
+         * and insert it into the wsse:Security header - set a reference of the
+         * created STR to the signature and use STR Transfrom during the
+         * signature
+         */
         Transforms transforms = null;
         SecurityTokenReference secRefSaml = null;
 
@@ -260,15 +275,14 @@
                 String nmSpace = encPart.getNamespace();
 
                 /*
-                * Set up the elements to sign. There are two resevered element
-                * names: "Token" and "STRTransform" "Token": Setup the
-                * Signature to either sign the information that points to the
-                * security token or the token itself. If its a direct
-                * reference sign the token, otherwise sign the KeyInfo
-                * Element. "STRTransform": Setup the ds:Reference to use STR
-                * Transform
-                *
-                */
+                 * Set up the elements to sign. There are two resevered element
+                 * names: "Token" and "STRTransform" "Token": Setup the
+                 * Signature to either sign the information that points to the
+                 * security token or the token itself. If its a direct reference
+                 * sign the token, otherwise sign the KeyInfo Element.
+                 * "STRTransform": Setup the ds:Reference to use STR Transform
+                 * 
+                 */
                 if (elemName.equals("Token")) {
                     transforms = new Transforms(doc);
                     transforms
@@ -309,12 +323,9 @@
         sig.addResourceResolver(EnvelopeIdResolver.getInstance());
 
         /*
-        * The order to prepend is:
-        * - signature
-        * - BinarySecurityToken (depends on mode)
-        * - SecurityTokenRefrence (depends on mode)
-        * - SAML token
-        */
+         * The order to prepend is: - signature - BinarySecurityToken (depends
+         * on mode) - SecurityTokenRefrence (depends on mode) - SAML token
+         */
 
         WSSecurityUtil.prependChildElement(doc, securityHeader, sig
                 .getElement(), false);
@@ -343,19 +354,19 @@
             secRef.setReference(ref);
             break;
         //
-        //            case WSConstants.ISSUER_SERIAL :
-        //                XMLX509IssuerSerial data =
-        //                    new XMLX509IssuerSerial(doc, certs[0]);
-        //                secRef.setX509IssuerSerial(data);
-        //                break;
+        // case WSConstants.ISSUER_SERIAL :
+        // XMLX509IssuerSerial data =
+        // new XMLX509IssuerSerial(doc, certs[0]);
+        // secRef.setX509IssuerSerial(data);
+        // break;
         //
-        //            case WSConstants.X509_KEY_IDENTIFIER :
-        //                secRef.setKeyIdentifier(certs[0]);
-        //                break;
+        // case WSConstants.X509_KEY_IDENTIFIER :
+        // secRef.setKeyIdentifier(certs[0]);
+        // break;
         //
-        //            case WSConstants.SKI_KEY_IDENTIFIER :
-        //                secRef.setKeyIdentifierSKI(certs[0], crypto);
-        //                break;
+        // case WSConstants.SKI_KEY_IDENTIFIER :
+        // secRef.setKeyIdentifierSKI(certs[0], crypto);
+        // break;
         //
         default:
             throw new WSSecurityException(WSSecurityException.FAILURE,



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org