作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec
类的一些代码示例,展示了XPathFilter2ParameterSpec
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathFilter2ParameterSpec
类的具体详情如下:
包路径:javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec
类名称:XPathFilter2ParameterSpec
暂无
代码示例来源:origin: com.hynnet/xws-security
transform.setAlgorithmParameters(new XPathFilter2ParameterSpec(xpathTypeList));
return;
代码示例来源:origin: com.hynnet/xws-security
/**
*
* @param algoSpec
* @param paramList
*/
public void addCanonicalizationParams(AlgorithmParameterSpec algoSpec,HashMap paramList){
//TODO::FixMe: Fill this appropriately.
if(algoSpec instanceof XPathFilterParameterSpec){
XPathFilterParameterSpec spec = (XPathFilterParameterSpec)algoSpec;
paramList.put("XPATH",spec.getXPath());
}else if(algoSpec instanceof XPathFilter2ParameterSpec){
XPathFilter2ParameterSpec spec = (XPathFilter2ParameterSpec)algoSpec;
paramList.put("XPATH2",spec.getXPathList());
}
}
代码示例来源:origin: be.fedict.eid-applet/eid-applet-service-signer
public void preSign(XMLSignatureFactory signatureFactory, Document document, String signatureId,
List<X509Certificate> signingCertificateChain, List<Reference> references, List<XMLObject> objects)
throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
DigestMethod digestMethod = signatureFactory.newDigestMethod(this.digestAlgo.getXmlAlgoId(), null);
List<Transform> transforms = new LinkedList<Transform>();
Map<String, String> xpathNamespaceMap = new HashMap<String, String>();
xpathNamespaceMap.put("ds", "http://www.w3.org/2000/09/xmldsig#");
// XPath v1 - slow...
// Transform envelopedTransform = signatureFactory.newTransform(
// CanonicalizationMethod.XPATH, new XPathFilterParameterSpec(
// "not(ancestor-or-self::ds:Signature)",
// xpathNamespaceMap));
// XPath v2 - fast...
List<XPathType> types = new ArrayList<XPathType>(1);
types.add(new XPathType("/descendant::*[name()='ds:Signature']", XPathType.Filter.SUBTRACT, xpathNamespaceMap));
Transform envelopedTransform = signatureFactory.newTransform(CanonicalizationMethod.XPATH2,
new XPathFilter2ParameterSpec(types));
transforms.add(envelopedTransform);
Transform exclusiveTransform = signatureFactory.newTransform(CanonicalizationMethod.EXCLUSIVE,
(TransformParameterSpec) null);
transforms.add(exclusiveTransform);
Reference reference = signatureFactory.newReference("", digestMethod, transforms, null, this.dsReferenceId);
references.add(reference);
}
代码示例来源:origin: org.apache.santuario/xmlsec
private static boolean paramsEqual(XPathFilter2ParameterSpec spec1,
XPathFilter2ParameterSpec spec2)
{
@SuppressWarnings("unchecked")
List<XPathType> types = spec1.getXPathList();
@SuppressWarnings("unchecked")
List<XPathType> otypes = spec2.getXPathList();
int size = types.size();
if (size != otypes.size()) {
return false;
}
for (int i = 0; i < size; i++) {
XPathType type = types.get(i);
XPathType otype = otypes.get(i);
if (!type.getExpression().equals(otype.getExpression()) ||
!type.getNamespaceMap().equals(otype.getNamespaceMap()) ||
type.getFilter() != otype.getFilter()) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.santuario/xmlsec
this.params = new XPathFilter2ParameterSpec(list);
代码示例来源:origin: org.apache.santuario/xmlsec
? "xmlns" : "xmlns:" + prefix;
@SuppressWarnings("unchecked")
List<XPathType> xpathList = xp.getXPathList();
for (XPathType xpathType : xpathList) {
Element elem = DOMUtils.createElement(ownerDoc, "XPath",
代码示例来源:origin: es.gob.afirma/afirma-crypto-core-xml
transformParam = new XPathFilter2ParameterSpec(
Collections.singletonList(
new XPathType(transformBody, xPath2TransformFilter)
代码示例来源:origin: com.itextpdf/itextpdf
private static Reference generateContentReference(XMLSignatureFactory fac, XmlSignatureAppearance sap, String referenceId)
throws GeneralSecurityException {
DigestMethod digestMethodSHA1 = fac.newDigestMethod(DigestMethod.SHA1, null);
List<Transform> transforms = new ArrayList<Transform>();
transforms.add(fac.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null));
// Create the Reference
XpathConstructor xpathConstructor = sap.getXpathConstructor();
if (xpathConstructor != null && xpathConstructor.getXpathExpression().length() > 0) {
XPathFilter2ParameterSpec xpath2Spec = new XPathFilter2ParameterSpec(Collections.singletonList(new XPathType(xpathConstructor.getXpathExpression(), XPathType.Filter.INTERSECT)));
transforms.add(fac.newTransform(Transform.XPATH2, xpath2Spec));
}
return fac.newReference("", digestMethodSHA1, transforms, null, referenceId);
}
代码示例来源:origin: com.itextpdf/itextg
private static Reference generateContentReference(XMLSignatureFactory fac, XmlSignatureAppearance sap, String referenceId)
throws GeneralSecurityException {
DigestMethod digestMethodSHA1 = fac.newDigestMethod(DigestMethod.SHA1, null);
List<Transform> transforms = new ArrayList<Transform>();
transforms.add(fac.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null));
// Create the Reference
XpathConstructor xpathConstructor = sap.getXpathConstructor();
if (xpathConstructor != null && xpathConstructor.getXpathExpression().length() > 0) {
XPathFilter2ParameterSpec xpath2Spec = new XPathFilter2ParameterSpec(Collections.singletonList(new XPathType(xpathConstructor.getXpathExpression(), XPathType.Filter.INTERSECT)));
transforms.add(fac.newTransform(Transform.XPATH2, xpath2Spec));
}
return fac.newReference("", digestMethodSHA1, transforms, null, referenceId);
}
代码示例来源:origin: es.gob.afirma/afirma-crypto-core-xml
params = new XPathFilter2ParameterSpec(Collections.singletonList(new XPathType(xpathTransformNode.getTextContent(), filter)));
break;
我是一名优秀的程序员,十分优秀!