|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.component.xmlsecurity.api.DefaultXmlSignature2Message
public class DefaultXmlSignature2Message
Maps the XML signature to a camel message. A output node is determined from the XML signature document via a node search and then serialized and set to the output message body.
There are three output node search types supported: "Default", "ElementName", and "XPath". All these search types support enveloped XML signature or enveloping XML signature.
Default Output Node Search:
In the enveloping XML signature case, the message body is determined from a referenced Object element in the following way:
DOMStructure
.
<Signature>
<SignedInfo>
<Reference URI="#object"/>
<!-- further references possible but they must not point to an Object or Manifest containing an object reference -->
...
</SignedInfo>
<Object Id="object">
<!-- contains the DOM node which should be extracted to the message body -->
<Object>
<!-- further object elements possible which are not referenced-->
...
(<KeyInfo>)?
</Signature>
or the structure
<Signature>
<SignedInfo>
<Reference URI="#manifest"/>
<!-- further references are possible but they must not point to an Object or other manifest containing an object reference -->
...
</SignedInfo>
<Object >
<Manifest Id="manifest">
<Reference URI=#object/>
</Manifest>
</Objet>
<Object Id="object">
<!-- contains the DOM node which should be extracted to the message body -->
</Object>
<!-- further object elements possible which are not referenced -->
...
(<KeyInfo>)?
</Signature>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.camel.component.xmlsecurity.api.XmlSignature2Message |
---|
XmlSignature2Message.Input |
Field Summary | |
---|---|
static String |
OUTPUT_NODE_SEARCH_TYPE_DEFAULT
Search type 'Default' for determining the output node. |
static String |
OUTPUT_NODE_SEARCH_TYPE_ELEMENT_NAME
Search type 'ElementName' for determining the output element. |
static String |
OUTPUT_NODE_SEARCH_TYPE_XPATH
Search type 'XPath' for determining the output node. |
Constructor Summary | |
---|---|
DefaultXmlSignature2Message()
|
Method Summary | |
---|---|
protected void |
addManifestReferencedObjects(List<XMLObject> allObjects,
List<XMLObject> referencedObjects,
String manifestId)
|
protected void |
checkSearchValueNotNull(XmlSignature2Message.Input input)
|
protected void |
checkSearchValueOfType(Class<?> cl,
XmlSignature2Message.Input input)
|
protected void |
checkStringSarchValueNotEmpty(String searchValue,
String outputNodeSearchType)
|
protected DOMStructure |
getDomStructureForMessageBody(List<Reference> relevantReferences,
List<XMLObject> relevantObjects)
Returns the DOM structure which is transformed to a byte array and set to the camel message body. |
protected Node |
getNodeForMessageBodyInNonEnvelopedCase(XmlSignature2Message.Input input)
|
protected String |
getNonEmptyStringSearchValue(XmlSignature2Message.Input input)
|
protected List<XMLObject> |
getObjectsForMessageMapping(XmlSignature2Message.Input input)
Returns the objects which must be taken into account for the mapping to the camel message. |
protected Node |
getOutputElementViaLocalNameAndNamespace(XmlSignature2Message.Input input)
|
protected Node |
getOutputNodeViaXPath(XmlSignature2Message.Input input)
|
protected Manifest |
getReferencedManifest(List<XMLObject> objects,
String id)
|
protected XMLObject |
getReferencedObject(List<XMLObject> objects,
String id)
|
protected List<XMLObject> |
getReferencedSameDocumentObjects(List<Reference> relevantReferences,
List<XMLObject> relevantObjects)
|
protected List<Reference> |
getReferencesForMessageMapping(XmlSignature2Message.Input input)
Returns the references whose referenced objects are taken into account for the message body. |
protected String |
getSameDocumentReferenceUri(Reference ref)
|
protected boolean |
isEnveloped(XmlSignature2Message.Input input)
Returns the enveloped data in case of an enveloped XML signature. |
void |
mapToMessage(XmlSignature2Message.Input input,
org.apache.camel.Message output)
Maps the references and objects of an XML signature to the camel message. |
protected Boolean |
omitXmlDeclaration(org.apache.camel.Message message,
XmlSignature2Message.Input input)
|
protected void |
removeSignatureElements(Node node)
Removes the Signature elements from the document. |
protected void |
transformNodeToByteArrayAndSetToOutputMessage(XmlSignature2Message.Input input,
org.apache.camel.Message output,
Node node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OUTPUT_NODE_SEARCH_TYPE_DEFAULT
public static final String OUTPUT_NODE_SEARCH_TYPE_ELEMENT_NAME
public static final String OUTPUT_NODE_SEARCH_TYPE_XPATH
XPathFilterParameterSpec
.
Constructor Detail |
---|
public DefaultXmlSignature2Message()
Method Detail |
---|
public void mapToMessage(XmlSignature2Message.Input input, org.apache.camel.Message output) throws Exception
XmlSignature2Message
mapToMessage
in interface XmlSignature2Message
input
- inputoutput
- output message
Exception
protected void transformNodeToByteArrayAndSetToOutputMessage(XmlSignature2Message.Input input, org.apache.camel.Message output, Node node) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException, IOException
TransformerFactoryConfigurationError
TransformerConfigurationException
TransformerException
IOException
protected Node getOutputNodeViaXPath(XmlSignature2Message.Input input) throws Exception
Exception
protected Node getOutputElementViaLocalNameAndNamespace(XmlSignature2Message.Input input) throws Exception
Exception
protected String getNonEmptyStringSearchValue(XmlSignature2Message.Input input) throws Exception
Exception
protected void checkSearchValueOfType(Class<?> cl, XmlSignature2Message.Input input) throws Exception
Exception
protected void checkStringSarchValueNotEmpty(String searchValue, String outputNodeSearchType) throws Exception
Exception
protected void checkSearchValueNotNull(XmlSignature2Message.Input input) throws Exception
Exception
protected Node getNodeForMessageBodyInNonEnvelopedCase(XmlSignature2Message.Input input) throws Exception
Exception
protected void removeSignatureElements(Node node)
doc
- documentprotected boolean isEnveloped(XmlSignature2Message.Input input) throws Exception
input
- references of signed info and objects
true
if there exists a reference with URI = "" and
with Transform.ENVELOPED
transform; otherwise
false
Exception
protected Boolean omitXmlDeclaration(org.apache.camel.Message message, XmlSignature2Message.Input input)
protected List<Reference> getReferencesForMessageMapping(XmlSignature2Message.Input input) throws Exception
input
- references and objects
Exception
- if an error occursprotected List<XMLObject> getObjectsForMessageMapping(XmlSignature2Message.Input input) throws Exception
input
- references and objects
Exception
- if an error occursprotected DOMStructure getDomStructureForMessageBody(List<Reference> relevantReferences, List<XMLObject> relevantObjects) throws Exception
relevantReferences
- input from method
#getReferencesForMessageMapping(ReferencesAndObjects)
relevantObjects
- input from method
#getObjectsForMessageMapping(ReferencesAndObjects)
Exception
- if an error occursprotected List<XMLObject> getReferencedSameDocumentObjects(List<Reference> relevantReferences, List<XMLObject> relevantObjects)
protected void addManifestReferencedObjects(List<XMLObject> allObjects, List<XMLObject> referencedObjects, String manifestId)
protected String getSameDocumentReferenceUri(Reference ref)
protected Manifest getReferencedManifest(List<XMLObject> objects, String id)
protected XMLObject getReferencedObject(List<XMLObject> objects, String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |