public final class XmlSignatureHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlSignatureHelper.XPathAndFilter |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static AlgorithmMethod getCanonicalizationMethod(String algorithm)
algorithm - algorithm URIIllegalArgumentException - if algorithm is nullpublic 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
exclusiveIllegalArgumentException - if algorithm is nullpublic static AlgorithmMethod getEnvelopedTransform()
public static AlgorithmMethod getBase64Transform()
public static AlgorithmMethod getXPathTransform(String xpath)
xpath - XPATH expressionIllegalArgumentException - if xpath is nullpublic static AlgorithmMethod getXPathTransform(String xpath, Map<String,String> namespaceMap)
xpath - XPATH expressionnamespaceMap - namespace map, key is the prefix, value is the namespace, can
be nullIllegalArgumentException - if xpath is nullpublic static XPathFilterParameterSpec getXpathFilter(String xpath, Map<String,String> namespaceMap)
public static XPathExpression getXPathExpression(XPathFilterParameterSpec xpathFilter) throws XPathExpressionException
XPathExpressionExceptionpublic 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 nullIllegalArgumentException - 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 nullIllegalArgumentException - 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 filtersIllegalArgumentException - 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 classpathIllegalArgumentException - if path is nullIllegalStateException - if the XSL file cannot be foundException - 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 XSLIllegalArgumentException - if is is nullException - if an error during the reading of the XSL file occursSAXExceptionIOExceptionParserConfigurationExceptionprotected static InputStream readXslTransform(String path) throws Exception
Exceptionpublic static List<AlgorithmMethod> getTransforms(List<AlgorithmMethod> list)
public static DocumentBuilder newDocumentBuilder(Boolean disallowDoctypeDecl) throws ParserConfigurationException
ParserConfigurationExceptionpublic static void transformToOutputStream(Node node, OutputStream os, boolean omitXmlDeclaration) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException, IOException
public static void transformNonTextNodeToOutputStream(Node node, OutputStream os, boolean omitXmlDeclaration) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException
public static byte[] tranformTextNodeToByteArray(Node node)
Apache Camel