本文整理了Java中org.apache.xml.security.signature.XMLSignatureInput.isElement()
方法的一些代码示例,展示了XMLSignatureInput.isElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSignatureInput.isElement()
方法的具体详情如下:
包路径:org.apache.xml.security.signature.XMLSignatureInput
类名称:XMLSignatureInput
方法名:isElement
[英]Determines if the object has been set up with an Element
[中]确定是否已使用元素设置对象
代码示例来源:origin: org.apache.santuario/xmlsec
/**
* Resolve the Element effectively represented by the XML signature input source.
*
* @param resource
* @return the Element effectively represented by the XML signature input source.
* @throws CanonicalizationException
* @throws ParserConfigurationException
* @throws IOException
* @throws SAXException
* @throws KeyResolverException
*/
private Element obtainReferenceElement(XMLSignatureInput resource)
throws CanonicalizationException, ParserConfigurationException,
IOException, SAXException, KeyResolverException {
Element e;
if (resource.isElement()){
e = (Element) resource.getSubNode();
} else if (resource.isNodeSet()) {
LOG.debug("De-reference of KeyInfoReference returned an unsupported NodeSet");
return null;
} else {
// Retrieved resource is a byte stream
byte inputBytes[] = resource.getBytes();
e = getDocFromBytes(inputBytes, this.secureValidation);
}
return e;
}
}
代码示例来源:origin: org.apache.santuario/xmlsec
private static Element obtainReferenceElement(XMLSignatureInput resource, boolean secureValidation)
throws CanonicalizationException, ParserConfigurationException,
IOException, SAXException, KeyResolverException {
Element e;
if (resource.isElement()){
e = (Element) resource.getSubNode();
} else if (resource.isNodeSet()) {
// Retrieved resource is a nodeSet
e = getDocumentElement(resource.getNodeSet());
} else {
// Retrieved resource is an inputStream
byte inputBytes[] = resource.getBytes();
e = getDocFromBytes(inputBytes, secureValidation);
// otherwise, we parse the resource, create an Element and delegate
LOG.debug("we have to parse {} bytes", inputBytes.length);
}
return e;
}
代码示例来源:origin: org.apache.santuario/xmlsec
/**
* Method toString
* {@inheritDoc}
*/
public String toString() {
if (isNodeSet()) {
return "XMLSignatureInput/NodeSet/" + inputNodeSet.size()
+ " nodes/" + getSourceURI();
}
if (isElement()) {
return "XMLSignatureInput/Element/" + subNode
+ " exclude "+ excludeNode + " comments:"
+ excludeComments +"/" + getSourceURI();
}
try {
return "XMLSignatureInput/OctetStream/" + getBytes().length
+ " octets/" + getSourceURI();
} catch (IOException iex) {
return "XMLSignatureInput/OctetStream//" + getSourceURI();
} catch (CanonicalizationException cex) {
return "XMLSignatureInput/OctetStream//" + getSourceURI();
}
}
代码示例来源:origin: luisgoncalves/xades4j
private void addToDigestInput(XMLSignatureInput refData, Document doc) throws CannotAddDataToDigestInputException
{
try
{
if (refData.isNodeSet() || refData.isElement())
{
Transform c14nTransform = TransformUtils.createTransform(this.c14n, this.parametersMarshallingProvider, doc);
refData = c14nTransform.performTransform(refData);
// Fall through to add the bytes resulting from the canonicalization.
}
if (refData.isByteArray())
{
digestInput.write(refData.getBytes());
} else if (refData.isOctetStream())
{
StreamUtils.readWrite(refData.getOctetStream(), digestInput);
}
}
catch (Exception ex)
{
throw new CannotAddDataToDigestInputException(ex);
}
}
代码示例来源:origin: org.apache.santuario/xmlsec
XMLSignatureInput in =
((ApacheData)data).getXMLSignatureInput();
if (in.isElement()) {
if (inclusiveNamespaces != null) {
return new OctetStreamData(new ByteArrayInputStream
代码示例来源:origin: org.apache.santuario/xmlsec
return null;
} else if (xsi.isElement()) {
return new DOMSubTreeData
(xsi.getSubNode(), xsi.isExcludeComments());
代码示例来源:origin: org.apache.santuario/xmlsec
} else if (input.isElement()) {
referenceData = new ReferenceSubTreeData
(input.getSubNode(), input.isExcludeComments());
代码示例来源:origin: org.apache.santuario/xmlsec
protected XMLSignatureInput enginePerformTransform(
XMLSignatureInput input, OutputStream os, Transform transformObject
) throws IOException, CanonicalizationException, TransformationException {
if (input.isElement()) {
Node el = input.getSubNode();
if (input.getSubNode().getNodeType() == Node.TEXT_NODE) {
代码示例来源:origin: org.apache.santuario/xmlsec
if (!in.isNodeSet() && !in.isElement()) {
return null;
代码示例来源:origin: org.apache.santuario/xmlsec
if (os != null) {
in = apacheTransform.performTransform(in, os);
if (!in.isNodeSet() && !in.isElement()) {
return null;
代码示例来源:origin: org.apache.santuario/xmlsec
return engineCanonicalize(input.getBytes());
if (input.isElement()) {
return engineCanonicalizeSubTree(input.getSubNode(), input.getExcludeNode());
} else if (input.isNodeSet()) {
内容来源于网络,如有侵权,请联系作者删除!