Class WSSecDKEncrypt
java.lang.Object
org.apache.ws.security.message.WSSecBase
org.apache.ws.security.message.WSSecDerivedKeyBase
org.apache.ws.security.message.WSSecDKEncrypt
Encrypts and signes parts of a message with derived keys derived from a
symmetric key. This symmetric key will be included as an EncryptedKey
- Author:
- Ruchith Fernando (ruchith.fernando@gmail.com)
-
Field Summary
FieldsFields inherited from class WSSecDerivedKeyBase
clientLabel, derivedKeyBytes, derivedKeyLength, dkt, dktId, document, envelope, ephemeralKey, serviceLabel, strElem, tokenIdentifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalRefElement(Element referenceList, WSSecHeader secHeader) Adds (prepends) the external Reference element to the Security header.build(Document doc, WSSecHeader secHeader) static ElementcreateDataRefList(Document doc, Element referenceList, Vector encDataRefs) encryptForExternalRef(Element dataRef, Vector references) Encrypt one or more parts or elements of the message (external).protected intThe derived key will change depending on the sig/encr algorithm.voidMethods inherited from class WSSecDerivedKeyBase
appendDKElementToHeader, getdktElement, getId, getTokenIdentifier, prepare, prependDKElementToHeader, setClientLabel, setDerivedKeyLength, setExternalKey, setExternalKey, setServiceLabel, setWscVersionMethods inherited from class WSSecBase
getKeyIdentifierType, setBodyID, setKeyIdentifierType, setParts, setUserInfo, setWsConfig, setWsuId
-
Field Details
-
symEncAlgo
-
-
Constructor Details
-
WSSecDKEncrypt
public WSSecDKEncrypt()
-
-
Method Details
-
build
public Document build(Document doc, WSSecHeader secHeader) throws WSSecurityException, org.apache.ws.security.conversation.ConversationException - Throws:
WSSecurityExceptionorg.apache.ws.security.conversation.ConversationException
-
encryptForExternalRef
Encrypt one or more parts or elements of the message (external). This method takes a vector ofWSEncryptionPartobject that contain information about the elements to encrypt. The method call the encryption method, takes the reference information generated during encryption and add this to thexenc:Referenceelement. This method can be called afterprepare()and can be called multiple times to encrypt a number of parts or elements. The method generates axenc:Referenceelement that must be added to the SecurityHeader. SeeaddExternalRefElement(). If thedataRefparameter isnullthe method creates and initializes a new Reference element.- Parameters:
dataRef- Axenc:Referenceelement ornullreferences- A vector containing WSEncryptionPart objects- Returns:
- Returns the updated
xenc:Referenceelement - Throws:
WSSecurityException
-
addExternalRefElement
Adds (prepends) the external Reference element to the Security header. The reference element must be created by theencryptForExternalRef()method. The method adds the reference element in the SecurityHeader.- Parameters:
secHeader- The security header.dataRef- The externalenc:Referenceelement
-
createDataRefList
-
setSymmetricEncAlgorithm
-
getDerivedKeyLength
Description copied from class:WSSecDerivedKeyBaseThe derived key will change depending on the sig/encr algorithm. Therefore the child classes are expected to provide this value.- Specified by:
getDerivedKeyLengthin classWSSecDerivedKeyBase- Returns:
- Throws:
WSSecurityException- See Also:
-