public class WSSecEncrypt extends WSSecEncryptedKey
encryptedEphemeralKey, symmetricKey
addWSUNamespace, attachmentCallbackHandler, callbackLookup, expandXopInclude, keyIdentifierType, password, storeBytesInAttachment, user
Constructor and Description |
---|
WSSecEncrypt(Document doc) |
WSSecEncrypt(WSSecHeader securityHeader) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachmentEncryptedDataElements() |
void |
addExternalRefElement(Element dataRef)
Adds (prepends) the external Reference element to the Security header.
|
void |
addInternalRefElement(Element dataRef)
Adds the internal Reference element to this Encrypt data.
|
Document |
build(Crypto crypto)
Builds the SOAP envelope with encrypted Body and adds encrypted key.
|
static Element |
createDataRefList(Document doc,
Element referenceList,
List<String> encDataRefs)
Create DOM subtree for
xenc:EncryptedKey |
Element |
encrypt() |
Element |
encryptForRef(Element dataRef,
List<WSEncryptionPart> references)
Encrypt one or more parts or elements of the message.
|
List<Element> |
getAttachmentEncryptedDataElements() |
org.apache.xml.security.encryption.Serializer |
getEncryptionSerializer() |
SecurityTokenReference |
getSecurityTokenReference() |
boolean |
isEmbedEncryptedKey() |
boolean |
isEncryptSymmKey() |
void |
prepare(Crypto crypto)
Initialize a WSSec Encrypt.
|
void |
setCustomReferenceValue(String customReferenceValue) |
void |
setEmbedEncryptedKey(boolean embedEncryptedKey) |
void |
setEncKeyIdDirectId(boolean b) |
void |
setEncryptionSerializer(org.apache.xml.security.encryption.Serializer encryptionSerializer) |
void |
setEncryptSymmKey(boolean encryptSymmKey) |
void |
setSecurityTokenReference(SecurityTokenReference reference) |
appendBSTElementToHeader, appendToHeader, clean, createCipherValue, createEncryptedKey, getBinarySecurityTokenElement, getBSTTokenId, getCustomEKKeyInfoElement, getDigestAlgorithm, getEncryptedEphemeralKey, getEncryptedKeyElement, getEphemeralKey, getId, getKeyEncAlgo, getMGFAlgorithm, getSymmetricEncAlgorithm, getSymmetricKey, getUseThisCert, getUseThisPublicKey, isCertSet, isIncludeEncryptionToken, prepareInternal, prepareInternal, prepareInternal, prependBSTElementToHeader, prependToHeader, setCustomEKKeyInfoElement, setCustomEKTokenId, setCustomEKTokenValueType, setDigestAlgorithm, setEncKeyId, setEncryptedEphemeralKey, setEncryptedKeyElement, setEphemeralKey, setIncludeEncryptionToken, setKeyEncAlgo, setMGFAlgorithm, setSymmetricEncAlgorithm, setSymmetricKey, setUserInfo, setUseThisCert, setUseThisPublicKey
getDocument, getIdAllocator, getKeyIdentifierType, getParts, getSecurityHeader, getWsDocInfo, isExpandXopInclude, setAttachmentCallbackHandler, setBodyID, setCallbackLookup, setExpandXopInclude, setIdAllocator, setKeyIdentifierType, setStoreBytesInAttachment, setUserInfo, setWsDocInfo, setWsuId
public WSSecEncrypt(WSSecHeader securityHeader)
public WSSecEncrypt(Document doc)
public void prepare(Crypto crypto) throws WSSecurityException
prepare
in class WSSecEncryptedKey
crypto
- An instance of the Crypto API to handle keystore and certificatesWSSecurityException
public Document build(Crypto crypto) throws WSSecurityException
crypto
- an instance of the Crypto API to handle keystore and CertificatesDocument
WSSecurityException
public Element encrypt() throws WSSecurityException
WSSecurityException
public Element encryptForRef(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 this token. See addInternalRefElement()
.
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 addInternalRefElement(Element dataRef)
encryptForInternalRef()
method. The reference element is
added to the EncryptedKey
element of this encrypt block.dataRef
- The internal enc:Reference
elementpublic void addExternalRefElement(Element dataRef)
encryptForExternalRef()
method. The method prepends the
reference element in the SecurityHeader.dataRef
- The external enc:Reference
elementpublic void addAttachmentEncryptedDataElements()
public static Element createDataRefList(Document doc, Element referenceList, List<String> encDataRefs)
xenc:EncryptedKey
doc
- the SOAP envelope parent documentreferenceList
- encDataRefs
- xenc:EncryptedKey
elementpublic SecurityTokenReference getSecurityTokenReference()
public void setSecurityTokenReference(SecurityTokenReference reference)
reference
- public boolean isEncryptSymmKey()
public void setEncryptSymmKey(boolean encryptSymmKey)
public void setCustomReferenceValue(String customReferenceValue)
public void setEncKeyIdDirectId(boolean b)
public void setEmbedEncryptedKey(boolean embedEncryptedKey)
public boolean isEmbedEncryptedKey()
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.