org.apache.ws.security.message
Class WSSignEnvelope

java.lang.Object
  extended byorg.apache.ws.security.message.WSBaseMessage
      extended byorg.apache.ws.security.message.WSSignEnvelope
Direct Known Subclasses:
WSSignSAMLEnvelope

public class WSSignEnvelope
extends WSBaseMessage

Signs a SOAP envelope according to WS Specification, X509 profile, and adds the signature data.

Author:
Davanum Srinivas (dims@yahoo.com), Werner Dittmann (Werner.Dittman@siemens.com)

Field Summary
protected  java.lang.String canonAlgo
           
protected  java.lang.String sigAlgo
           
protected  byte[] signatureValue
           
protected  WSSAddUsernameToken usernameToken
           
protected  boolean useSingleCert
           
 
Fields inherited from class org.apache.ws.security.message.WSBaseMessage
actor, doDebug, keyIdentifierType, mustunderstand, parts, password, timeToLive, user, wssConfig
 
Constructor Summary
WSSignEnvelope()
          Deprecated. replaced by WSSecSignature.WSSecSignature()
WSSignEnvelope(java.lang.String actor)
          Deprecated. replaced by WSSecSignature.WSSecSignature() and WSSecHeader for actor specification.
WSSignEnvelope(java.lang.String actor, boolean mu)
          Deprecated. replaced by WSSecSignature.WSSecSignature() and WSSecHeader for actor and mustunderstand specification.
 
Method Summary
 org.w3c.dom.Document build(org.w3c.dom.Document doc, Crypto crypto)
          Deprecated. replaced by WSSecSignature.build(Document, Crypto, WSSecHeader)
protected  org.w3c.dom.Element createSTRParameter(org.w3c.dom.Document doc)
           
protected  java.util.Set getInclusivePrefixes(org.w3c.dom.Element target)
           
protected  java.util.Set getInclusivePrefixes(org.w3c.dom.Element target, boolean excludeVisible)
           
 java.lang.String getSigCanonicalization()
          Deprecated. replaced by WSSecSignature.getSigCanonicalization()
 java.lang.String getSignatureAlgorithm()
          Deprecated. replaced by WSSecSignature.getSignatureAlgorithm()
 byte[] getSignatureValue()
          Deprecated. replaced by WSSecSignature.getSignatureValue()
 boolean isUseSingleCertificate()
          Deprecated. replaced by WSSecSignature.isUseSingleCertificate()
 void setSigCanonicalization(java.lang.String algo)
          Deprecated. replaced by WSSecSignature.setSigCanonicalization(String)
 void setSignatureAlgorithm(java.lang.String algo)
          Deprecated. replaced by WSSecSignature.setSignatureAlgorithm(String)
 void setUsernameToken(WSSAddUsernameToken usernameToken)
          Deprecated. replaced by WSSecSignature.setUsernameToken(WSSecUsernameToken)
 void setUseSingleCertificate(boolean useSingleCert)
          Deprecated. replaced by WSSecSignature.setUseSingleCertificate(boolean)
 
Methods inherited from class org.apache.ws.security.message.WSBaseMessage
getKeyIdentifierType, insertSecurityHeader, setActor, setBodyID, setKeyIdentifierType, setMustUnderstand, setParts, setTimeToLive, setUserInfo, setWsConfig, setWsuId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useSingleCert

protected boolean useSingleCert

sigAlgo

protected java.lang.String sigAlgo

canonAlgo

protected java.lang.String canonAlgo

usernameToken

protected WSSAddUsernameToken usernameToken

signatureValue

protected byte[] signatureValue
Constructor Detail

WSSignEnvelope

public WSSignEnvelope()
Deprecated. replaced by WSSecSignature.WSSecSignature()

Constructor.


WSSignEnvelope

public WSSignEnvelope(java.lang.String actor)
Deprecated. replaced by WSSecSignature.WSSecSignature() and WSSecHeader for actor specification.

Constructor.

Parameters:
actor - The actor name of the wsse:Security header

WSSignEnvelope

public WSSignEnvelope(java.lang.String actor,
                      boolean mu)
Deprecated. replaced by WSSecSignature.WSSecSignature() and WSSecHeader for actor and mustunderstand specification.

Constructor.

Parameters:
actor - The actor name of the wsse:Security header
mu - Set mustUnderstand to true or false
Method Detail

setUseSingleCertificate

public void setUseSingleCertificate(boolean useSingleCert)
Deprecated. replaced by WSSecSignature.setUseSingleCertificate(boolean)

set the single cert flag.

Parameters:
useSingleCert -

isUseSingleCertificate

public boolean isUseSingleCertificate()
Deprecated. replaced by WSSecSignature.isUseSingleCertificate()

Get the single cert flag.

Returns:
If to use a single cert

setSignatureAlgorithm

public void setSignatureAlgorithm(java.lang.String algo)
Deprecated. replaced by WSSecSignature.setSignatureAlgorithm(String)

Set the name of the signature encryption algorithm to use. If the algorithm is not set then Triple RSA is used. Refer to WSConstants which algorithms are supported.

Parameters:
algo - Is the name of the signature algorithm
See Also:
WSConstants.RSA, WSConstants.DSA

getSignatureAlgorithm

public java.lang.String getSignatureAlgorithm()
Deprecated. replaced by WSSecSignature.getSignatureAlgorithm()

Get the name of the signature algorithm that is being used. If the algorithm is not set then RSA is default.

Returns:
the identifier URI of the signature algorithm

setSigCanonicalization

public void setSigCanonicalization(java.lang.String algo)
Deprecated. replaced by WSSecSignature.setSigCanonicalization(String)

Set the canonicalization method to use. If the canonicalization method is not set then the recommended Exclusive XML Canonicalization is used by default Refer to WSConstants which algorithms are supported.

Parameters:
algo - Is the name of the signature algorithm
See Also:
WSConstants.C14N_OMIT_COMMENTS, WSConstants.C14N_WITH_COMMENTS, WSConstants.C14N_EXCL_OMIT_COMMENTS, WSConstants.C14N_EXCL_WITH_COMMENTS

getSigCanonicalization

public java.lang.String getSigCanonicalization()
Deprecated. replaced by WSSecSignature.getSigCanonicalization()

Get the canonicalization method. If the canonicalization method was not set then Exclusive XML Canonicalization is used by default.

Returns:
TODO

setUsernameToken

public void setUsernameToken(WSSAddUsernameToken usernameToken)
Deprecated. replaced by WSSecSignature.setUsernameToken(WSSecUsernameToken)

Parameters:
usernameToken - The usernameToken to set.

getSignatureValue

public byte[] getSignatureValue()
Deprecated. replaced by WSSecSignature.getSignatureValue()

Returns:
Returns the signatureValue.

build

public org.w3c.dom.Document build(org.w3c.dom.Document doc,
                                  Crypto crypto)
                           throws WSSecurityException
Deprecated. replaced by WSSecSignature.build(Document, Crypto, WSSecHeader)

Builds a signed soap envelope. 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 wsse:Signature

Parameters:
doc - The unsigned SOAP envelope as Document
crypto - An instance of the Crypto API to handle keystore and certificates
Returns:
A signed SOAP envelope as Document
Throws:
WSSecurityException

createSTRParameter

protected org.w3c.dom.Element createSTRParameter(org.w3c.dom.Document doc)

getInclusivePrefixes

protected java.util.Set getInclusivePrefixes(org.w3c.dom.Element target)

getInclusivePrefixes

protected java.util.Set getInclusivePrefixes(org.w3c.dom.Element target,
                                             boolean excludeVisible)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.