|
||||||||||
| 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 SecretKey |
encryptionKey
Symmetric key that's actually used. |
protected String |
keyEncAlgo
|
protected 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 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. |
|
| 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 SecretKey symmetricKey
protected SecretKey encryptionKey
protected 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
header
public 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 false| Method 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_RSAOEPpublic 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_256public 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 Document build(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 Element createEncryptedKey(Document doc,
String keyTransportAlgo)
xenc:EncryptedKey
doc - the SOAP envelope parent documentkeyTransportAlgo - specifies which algorithm to use to encrypt the symmetric key
xenc:EncryptedKey element
public static Element createEnrcyptedKey(Document doc,
String keyTransportAlgo)
xenc:EncryptedKey
doc - the SOAP envelope parent documentkeyTransportAlgo - specifies which algorithm to use to encrypt the symmetric key
xenc:EncryptedKey element
public static Element createCipherValue(Document doc,
Element encryptedKey)
public static Element createDataRefList(Document doc,
Element encryptedKey,
Vector encDataRefs)
public void setParentNode(Element element)
element - public SecretKey getSymmetricKey()
WSSecEncrypt.getSymmetricKey()
public void setSymmetricKey(SecretKey key)
WSSecEncrypt.setSymmetricKey(SecretKey)
key - public 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 | |||||||||