|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.component.xmlsecurity.api.XmlSignatureHelper
public final class XmlSignatureHelper
Helps to construct the transformations and the canonicalization methods for the XML Signature generator.
Nested Class Summary | |
---|---|
static class |
XmlSignatureHelper.XPathAndFilter
|
Method Summary | |
---|---|
static AlgorithmMethod |
getBase64Transform()
Returns a configuration for a base64 transformation. |
static AlgorithmMethod |
getCanonicalizationMethod(String algorithm)
Returns a configuration for a canonicalization algorithm. |
static AlgorithmMethod |
getCanonicalizationMethod(String algorithm,
List<String> inclusiveNamespacePrefixes)
Returns a configuration for a canonicalization algorithm. |
static Document |
getDocument(Node node)
|
static AlgorithmMethod |
getEnvelopedTransform()
|
static List<Node> |
getTextAndElementChildren(Node node)
|
static List<AlgorithmMethod> |
getTransforms(List<AlgorithmMethod> list)
|
static AlgorithmMethod |
getXPath2Transform(List<XmlSignatureHelper.XPathAndFilter> xpathAndFilterList)
Returns a configuration for an XPATH2 transformation which consists of several XPATH expressions. |
static AlgorithmMethod |
getXPath2Transform(List<XmlSignatureHelper.XPathAndFilter> xpathAndFilterList,
Map<String,String> namespaceMap)
Returns a configuration for an XPATH2 transformation which consists of several XPATH expressions. |
static AlgorithmMethod |
getXPath2Transform(String xpath,
String filter)
Returns a configuration for an XPATH2 transformation. |
static AlgorithmMethod |
getXPath2Transform(String xpath,
String filter,
Map<String,String> namespaceMap)
Returns a configuration for an XPATH2 transformation which consists of several XPATH expressions. |
static XPathExpression |
getXPathExpression(XPathFilterParameterSpec xpathFilter)
|
static XPathFilterParameterSpec |
getXpathFilter(String xpath,
Map<String,String> namespaceMap)
|
static AlgorithmMethod |
getXPathTransform(String xpath)
Returns a configuration for an XPATH transformation. |
static AlgorithmMethod |
getXPathTransform(String xpath,
Map<String,String> namespaceMap)
Returns a configuration for an XPATH transformation which needs a namespace map. |
static AlgorithmMethod |
getXslTranform(InputStream is)
Returns a configuration for an XSL transformation. |
static AlgorithmMethod |
getXslTransform(String path)
Returns a configuration for an XSL transformation. |
static DocumentBuilder |
newDocumentBuilder(Boolean disallowDoctypeDecl)
|
protected static InputStream |
readXslTransform(String path)
|
static byte[] |
tranformTextNodeToByteArray(Node node)
|
static void |
transformNonTextNodeToOutputStream(Node node,
OutputStream os,
boolean omitXmlDeclaration)
|
static void |
transformToOutputStream(Node node,
OutputStream os,
boolean omitXmlDeclaration)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AlgorithmMethod getCanonicalizationMethod(String algorithm)
algorithm
- algorithm URI
IllegalArgumentException
- if algorithm is null
public static AlgorithmMethod getCanonicalizationMethod(String algorithm, List<String> inclusiveNamespacePrefixes)
algorithm
- algorithm URIinclusiveNamespacePrefixes
- namespace prefixes which should be treated like in the
inclusive canonicalization, only relevant if the algorithm is
exclusive
IllegalArgumentException
- if algorithm is null
public static AlgorithmMethod getEnvelopedTransform()
public static AlgorithmMethod getBase64Transform()
public static AlgorithmMethod getXPathTransform(String xpath)
xpath
- XPATH expression
IllegalArgumentException
- if xpath is null
public static AlgorithmMethod getXPathTransform(String xpath, Map<String,String> namespaceMap)
xpath
- XPATH expressionnamespaceMap
- namespace map, key is the prefix, value is the namespace, can
be null
IllegalArgumentException
- if xpath is null
public static XPathFilterParameterSpec getXpathFilter(String xpath, Map<String,String> namespaceMap)
public static XPathExpression getXPathExpression(XPathFilterParameterSpec xpathFilter) throws XPathExpressionException
XPathExpressionException
public static AlgorithmMethod getXPath2Transform(String xpath, String filter)
xpath
- XPATH expressionfilter
- possible values are "intersect", "subtract", "union"
IllegalArgumentException
- if xpath or filter is null
, or
is neither "intersect", nor "subtract", nor "union"public static AlgorithmMethod getXPath2Transform(String xpath, String filter, Map<String,String> namespaceMap)
xpathAndFilterList
- list of XPATH expressions with their filtersnamespaceMap
- namespace map, key is the prefix, value is the namespace, can
be null
IllegalArgumentException
- if xpathAndFilterList is null
or empty,
or the specified filter values are neither "intersect", nor
"subtract", nor "union"public static AlgorithmMethod getXPath2Transform(List<XmlSignatureHelper.XPathAndFilter> xpathAndFilterList, Map<String,String> namespaceMap)
xpathAndFilterList
- list of XPATH expressions with their filtersnamespaceMap
- namespace map, key is the prefix, value is the namespace, can
be null
IllegalArgumentException
- if xpathAndFilterList is null
or empty,
or the specified filter values are neither "intersect", nor
"subtract", nor "union"public static AlgorithmMethod getXPath2Transform(List<XmlSignatureHelper.XPathAndFilter> xpathAndFilterList)
xpathAndFilterList
- list of XPATH expressions with their filters
IllegalArgumentException
- if xpathAndFilterList is null
or empty,
or the specified filte values are neither "intersect", nor
"subtract", nor "union"public static AlgorithmMethod getXslTransform(String path) throws Exception
path
- path to the XSL file in the classpath
IllegalArgumentException
- if path is null
IllegalStateException
- if the XSL file cannot be found
Exception
- if an error during the reading of the XSL file occurspublic static AlgorithmMethod getXslTranform(InputStream is) throws SAXException, IOException, ParserConfigurationException
is
- input stream of the XSL
IllegalArgumentException
- if is is null
Exception
- if an error during the reading of the XSL file occurs
SAXException
IOException
ParserConfigurationException
protected static InputStream readXslTransform(String path) throws Exception
Exception
public static List<AlgorithmMethod> getTransforms(List<AlgorithmMethod> list)
public static List<Node> getTextAndElementChildren(Node node)
public static DocumentBuilder newDocumentBuilder(Boolean disallowDoctypeDecl) throws ParserConfigurationException
ParserConfigurationException
public static void transformToOutputStream(Node node, OutputStream os, boolean omitXmlDeclaration) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException, IOException
TransformerFactoryConfigurationError
TransformerConfigurationException
TransformerException
IOException
public static void transformNonTextNodeToOutputStream(Node node, OutputStream os, boolean omitXmlDeclaration) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException
TransformerFactoryConfigurationError
TransformerConfigurationException
TransformerException
public static byte[] tranformTextNodeToByteArray(Node node)
public static Document getDocument(Node node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |