gpt4 book ai didi

javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 20:25:40 25 4
gpt4 key购买 nike

本文整理了Java中javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec类的一些代码示例,展示了XPathFilter2ParameterSpec类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathFilter2ParameterSpec类的具体详情如下:
包路径:javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec
类名称: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;

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com