|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ws.security.message.WSBaseMessage
org.apache.ws.security.message.WSEncryptBody
public class WSEncryptBody
Encrypts a SOAP body inside a SOAP envelope according to WS Specification, X509 profile, and adds the encryption data.
Field Summary | |
---|---|
protected byte[] |
embeddedKey
|
protected String |
embeddedKeyName
|
protected String |
encCanonAlgo
|
protected javax.crypto.SecretKey |
encryptionKey
Symmetric key that's actually used. |
protected String |
keyEncAlgo
|
protected org.w3c.dom.Element |
parentNode
Parent node to which the EncryptedKeyElement should be added. |
protected SecurityTokenReference |
securityTokenReference
SecurityTokenReference to be inserted into EncryptedData/keyInfo element. |
protected String |
symEncAlgo
|
protected javax.crypto.SecretKey |
symmetricKey
Symmetric key used in the EncrytpedKey. |
protected X509Certificate |
useThisCert
|
Fields inherited from class org.apache.ws.security.message.WSBaseMessage |
---|
actor, doDebug, keyIdentifierType, mustunderstand, parts, password, timeToLive, user, wssConfig |
Constructor Summary | |
---|---|
WSEncryptBody()
Deprecated. replaced by WSSecEncrypt.WSSecEncrypt() |
|
WSEncryptBody(String actor)
Deprecated. replaced by WSSecEncrypt.WSSecEncrypt()
and WSSecHeader for actor specification. |
|
WSEncryptBody(String actor,
boolean mu)
Deprecated. replaced by WSSecEncrypt.WSSecEncrypt()
and WSSecHeader for actor and mustunderstand
specification. |
Method Summary | |
---|---|
org.w3c.dom.Document |
build(org.w3c.dom.Document doc,
Crypto crypto)
Deprecated. replaced by WSSecEncrypt.build(Document, Crypto, WSSecHeader) |
static org.w3c.dom.Element |
createCipherValue(org.w3c.dom.Document doc,
org.w3c.dom.Element encryptedKey)
|
static org.w3c.dom.Element |
createDataRefList(org.w3c.dom.Document doc,
org.w3c.dom.Element encryptedKey,
Vector encDataRefs)
|
static org.w3c.dom.Element |
createEncryptedKey(org.w3c.dom.Document doc,
String keyTransportAlgo)
Create DOM subtree for xenc:EncryptedKey |
static org.w3c.dom.Element |
createEnrcyptedKey(org.w3c.dom.Document doc,
String keyTransportAlgo)
Deprecated. use createEncryptedKey(Document doc, String keyTransportAlgo) instead |
javax.crypto.SecretKey |
getEncryptionKey()
Deprecated. replaced by WSSecEncryptedKey.getEncryptedEphemeralKey() |
SecurityTokenReference |
getSecurityTokenReference()
Deprecated. replaced by WSSecEncrypt.getSecurityTokenReference() |
String |
getSymmetricEncAlgorithm()
Deprecated. replaced by WSSecEncrypt.getSymmetricEncAlgorithm() |
javax.crypto.SecretKey |
getSymmetricKey()
Deprecated. replaced by WSSecEncrypt.getSymmetricKey() |
void |
setEmbeddedKeyName(String embeddedKeyName)
Deprecated. replaced by WSSecEncrypt.setEmbeddedKeyName(String) |
void |
setEncCanonicalization(String algo)
Deprecated. replaced by WSSecEncrypt.setEncCanonicalization(String) |
void |
setKey(byte[] key)
Deprecated. replaced by WSSecEncrypt.setKey(byte[]) |
void |
setKeyEnc(String keyEnc)
Deprecated. replaced by WSSecEncrypt.setKeyEnc(String) |
void |
setParentNode(org.w3c.dom.Element element)
Deprecated. |
void |
setSecurityTokenReference(SecurityTokenReference reference)
Deprecated. replaced by WSSecEncrypt.setSecurityTokenReference(SecurityTokenReference) |
void |
setSymmetricEncAlgorithm(String algo)
Deprecated. replaced by WSSecEncrypt.setSymmetricEncAlgorithm(String) |
void |
setSymmetricKey(javax.crypto.SecretKey key)
Deprecated. replaced by WSSecEncrypt.setSymmetricKey(SecretKey) |
void |
setUserInfo(String user)
Deprecated. replaced by WSSecEncryptedKey.setUserInfo(String) |
void |
setUseThisCert(X509Certificate cert)
Deprecated. replaced by WSSecEncryptedKey.setUseThisCert(X509Certificate) |
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 |
---|
protected String symEncAlgo
protected String keyEncAlgo
protected String encCanonAlgo
protected byte[] embeddedKey
protected String embeddedKeyName
protected X509Certificate useThisCert
protected javax.crypto.SecretKey symmetricKey
protected javax.crypto.SecretKey encryptionKey
protected org.w3c.dom.Element parentNode
protected SecurityTokenReference securityTokenReference
Constructor Detail |
---|
public WSEncryptBody()
WSSecEncrypt.WSSecEncrypt()
public WSEncryptBody(String actor)
WSSecEncrypt.WSSecEncrypt()
and WSSecHeader
for actor specification.
actor
- The actor name of the wsse:Security
headerpublic WSEncryptBody(String actor, boolean mu)
WSSecEncrypt.WSSecEncrypt()
and WSSecHeader
for actor and mustunderstand
specification.
actor
- The actor name of the wsse:Security
headermu
- Set mustUnderstand
to true or falseMethod Detail |
---|
public void setKey(byte[] key)
WSSecEncrypt.setKey(byte[])
key
- to use during encryption. The key must fit the
selected symmetrical encryption algorithmpublic void setKeyEnc(String keyEnc)
WSSecEncrypt.setKeyEnc(String)
WSConstants.KEYTRANSPORT_RSA15
algorithm.
keyEnc
- specifies the key encoding algorithm.WSConstants.KEYTRANSPORT_RSA15
,
WSConstants.KEYTRANSPORT_RSAOEP
public void setUserInfo(String user)
WSSecEncryptedKey.setUserInfo(String)
user
- public void setEmbeddedKeyName(String embeddedKeyName)
WSSecEncrypt.setEmbeddedKeyName(String)
embeddedKeyName
- public void setUseThisCert(X509Certificate cert)
WSSecEncryptedKey.setUseThisCert(X509Certificate)
DirectReference
then use this certificate
to get the public key for encryption.
cert
- is the X509 certificate to use for encryptionpublic void setSymmetricEncAlgorithm(String algo)
WSSecEncrypt.setSymmetricEncAlgorithm(String)
algo
- Is the name of the encryption algorithmWSConstants.TRIPLE_DES
,
WSConstants.AES_128
,
WSConstants.AES_192
,
WSConstants.AES_256
public void setEncCanonicalization(String algo)
WSSecEncrypt.setEncCanonicalization(String)
algo
- Is the name of the canonicalization algorithmpublic String getSymmetricEncAlgorithm()
WSSecEncrypt.getSymmetricEncAlgorithm()
WSConstants.TRIPLE_DES
,
WSConstants.AES_128
,
WSConstants.AES_192
,
WSConstants.AES_256
public org.w3c.dom.Document build(org.w3c.dom.Document doc, Crypto crypto) throws WSSecurityException
WSSecEncrypt.build(Document, Crypto, WSSecHeader)
xenc:EncryptedData
wsse:Security
header block
doc
- the SOAP envelope as Document
with
plaintext Bodycrypto
- an instance of the Crypto API to handle keystore and
Certificates
Document
WSSecurityException
public static org.w3c.dom.Element createEncryptedKey(org.w3c.dom.Document doc, String keyTransportAlgo)
xenc:EncryptedKey
doc
- the SOAP envelope parent documentkeyTransportAlgo
- specifies which algorithm to use to encrypt the symmetric key
xenc:EncryptedKey
elementpublic static org.w3c.dom.Element createEnrcyptedKey(org.w3c.dom.Document doc, String keyTransportAlgo)
xenc:EncryptedKey
doc
- the SOAP envelope parent documentkeyTransportAlgo
- specifies which algorithm to use to encrypt the symmetric key
xenc:EncryptedKey
elementpublic static org.w3c.dom.Element createCipherValue(org.w3c.dom.Document doc, org.w3c.dom.Element encryptedKey)
public static org.w3c.dom.Element createDataRefList(org.w3c.dom.Document doc, org.w3c.dom.Element encryptedKey, Vector encDataRefs)
public void setParentNode(org.w3c.dom.Element element)
element
- public javax.crypto.SecretKey getSymmetricKey()
WSSecEncrypt.getSymmetricKey()
public void setSymmetricKey(javax.crypto.SecretKey key)
WSSecEncrypt.setSymmetricKey(SecretKey)
key
- public javax.crypto.SecretKey getEncryptionKey()
WSSecEncryptedKey.getEncryptedEphemeralKey()
public SecurityTokenReference getSecurityTokenReference()
WSSecEncrypt.getSecurityTokenReference()
public void setSecurityTokenReference(SecurityTokenReference reference)
WSSecEncrypt.setSecurityTokenReference(SecurityTokenReference)
reference
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |