public class WSSecDKEncrypt extends WSSecDerivedKeyBase
addWSUNamespace, attachmentCallbackHandler, callbackLookup, expandXopInclude, keyIdentifierType, password, storeBytesInAttachment, user
Constructor and Description |
---|
WSSecDKEncrypt(Document doc) |
WSSecDKEncrypt(WSSecHeader securityHeader) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachmentEncryptedDataElements() |
void |
addExternalRefElement(Element referenceList)
Adds (prepends) the external Reference element to the Security header.
|
Document |
build() |
Element |
encrypt() |
Element |
encryptForExternalRef(Element dataRef,
List<WSEncryptionPart> references)
Encrypt one or more parts or elements of the message (external).
|
List<Element> |
getAttachmentEncryptedDataElements() |
protected int |
getDerivedKeyLength()
The derived key will change depending on the sig/encr algorithm.
|
org.apache.xml.security.encryption.Serializer |
getEncryptionSerializer() |
void |
prepare()
Initialize a WSSec Derived key.
|
void |
setDerivedKeyLength(int keyLength) |
void |
setEncryptionSerializer(org.apache.xml.security.encryption.Serializer encryptionSerializer) |
void |
setSymmetricEncAlgorithm(String algo)
Set the symmetric encryption algorithm URI to use
|
appendDKElementToHeader, getDerivedKey, getdktElement, getId, getTokenIdentifier, getWscVersion, prependDKElementToHeader, setClientLabel, setCrypto, setCustomValueType, setExternalKey, setExternalKey, setServiceLabel, setTokenIdDirectId, setWscVersion, setX509Certificate
addReferencesToSign, cleanup, createSTRParameter, getInclusivePrefixes, getInclusivePrefixes
getDocument, getIdAllocator, getKeyIdentifierType, getParts, getSecurityHeader, getWsDocInfo, isExpandXopInclude, setAttachmentCallbackHandler, setBodyID, setCallbackLookup, setExpandXopInclude, setIdAllocator, setKeyIdentifierType, setStoreBytesInAttachment, setUserInfo, setWsDocInfo, setWsuId
public WSSecDKEncrypt(WSSecHeader securityHeader)
public WSSecDKEncrypt(Document doc)
public void prepare() throws WSSecurityException
WSSecDerivedKeyBase
prepare
in class WSSecDerivedKeyBase
WSSecurityException
public Document build() throws WSSecurityException
WSSecurityException
public void addAttachmentEncryptedDataElements()
public Element encrypt() throws WSSecurityException
WSSecurityException
public Element encryptForExternalRef(Element dataRef, List<WSEncryptionPart> references) throws WSSecurityException
WSEncryptionPart
object 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 the xenc:Reference
element.
This method can be called after prepare()
and can be
called multiple times to encrypt a number of parts or elements.
The method generates a xenc:Reference
element that must
be added to the SecurityHeader. See addExternalRefElement()
.
If the dataRef
parameter is null
the method
creates and initializes a new Reference element.dataRef
- A xenc:Reference
element or null
references
- A list containing WSEncryptionPart objectsxenc:Reference
elementWSSecurityException
public void addExternalRefElement(Element referenceList)
encryptForExternalRef()
method. The method adds the
reference element in the SecurityHeader.referenceList
- The external enc:Reference
elementpublic void setSymmetricEncAlgorithm(String algo)
algo
- the symmetric encryption algorithm URI to useprotected int getDerivedKeyLength() throws WSSecurityException
WSSecDerivedKeyBase
getDerivedKeyLength
in class WSSecDerivedKeyBase
WSSecurityException
public void setDerivedKeyLength(int keyLength)
public org.apache.xml.security.encryption.Serializer getEncryptionSerializer()
public void setEncryptionSerializer(org.apache.xml.security.encryption.Serializer encryptionSerializer)
Copyright © 2021 JBoss by Red Hat. All rights reserved.