Package org.apache.ws.security.message
Class WSSignEnvelope
- java.lang.Object
-
- org.apache.ws.security.message.WSBaseMessage
-
- org.apache.ws.security.message.WSSignEnvelope
-
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
Fields Modifier and Type Field Description 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
Constructors Constructor Description WSSignEnvelope()
Deprecated.replaced byWSSecSignature()
WSSignEnvelope(java.lang.String actor)
Deprecated.replaced byWSSecSignature()
andWSSecHeader
for actor specification.WSSignEnvelope(java.lang.String actor, boolean mu)
Deprecated.replaced byWSSecSignature()
andWSSecHeader
for actor and mustunderstand specification.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.w3c.dom.Document
build(org.w3c.dom.Document doc, Crypto crypto)
Deprecated.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 byWSSecSignature.getSigCanonicalization()
java.lang.String
getSignatureAlgorithm()
Deprecated.replaced byWSSecSignature.getSignatureAlgorithm()
byte[]
getSignatureValue()
Deprecated.replaced byWSSecSignature.getSignatureValue()
boolean
isUseSingleCertificate()
Deprecated.replaced byWSSecSignature.isUseSingleCertificate()
void
setSigCanonicalization(java.lang.String algo)
Deprecated.replaced byWSSecSignature.setSigCanonicalization(String)
void
setSignatureAlgorithm(java.lang.String algo)
Deprecated.replaced byWSSecSignature.setSignatureAlgorithm(String)
void
setUsernameToken(WSSAddUsernameToken usernameToken)
Deprecated.void
setUseSingleCertificate(boolean useSingleCert)
Deprecated.replaced byWSSecSignature.setUseSingleCertificate(boolean)
-
Methods inherited from class org.apache.ws.security.message.WSBaseMessage
getKeyIdentifierType, insertSecurityHeader, setActor, setBodyID, setKeyIdentifierType, setMustUnderstand, setParts, setTimeToLive, setUserInfo, setWsConfig, setWsuId
-
-
-
-
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 byWSSecSignature()
Constructor.
-
WSSignEnvelope
public WSSignEnvelope(java.lang.String actor)
Deprecated.replaced byWSSecSignature()
andWSSecHeader
for actor specification.Constructor.- Parameters:
actor
- The actor name of thewsse:Security
header
-
WSSignEnvelope
public WSSignEnvelope(java.lang.String actor, boolean mu)
Deprecated.replaced byWSSecSignature()
andWSSecHeader
for actor and mustunderstand specification.Constructor.- Parameters:
actor
- The actor name of thewsse:Security
headermu
- SetmustUnderstand
to true or false
-
-
Method Detail
-
setUseSingleCertificate
public void setUseSingleCertificate(boolean useSingleCert)
Deprecated.replaced byWSSecSignature.setUseSingleCertificate(boolean)
set the single cert flag.- Parameters:
useSingleCert
-
-
isUseSingleCertificate
public boolean isUseSingleCertificate()
Deprecated.replaced byWSSecSignature.isUseSingleCertificate()
Get the single cert flag.- Returns:
- If to use a single cert
-
setSignatureAlgorithm
public void setSignatureAlgorithm(java.lang.String algo)
Deprecated.replaced byWSSecSignature.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 byWSSecSignature.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 byWSSecSignature.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 byWSSecSignature.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.- Parameters:
usernameToken
- The usernameToken to set.
-
getSignatureValue
public byte[] getSignatureValue()
Deprecated.replaced byWSSecSignature.getSignatureValue()
- Returns:
- Returns the signatureValue.
-
build
public org.w3c.dom.Document build(org.w3c.dom.Document doc, Crypto crypto) throws WSSecurityException
Deprecated.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 thewsse:Signature
- Parameters:
doc
- The unsigned SOAP envelope asDocument
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)
-
-