javax.xml.crypto.dsig.Reference.getTransforms()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(147)

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

Reference.getTransforms介绍

[英]Returns an java.util.Collections#unmodifiableList of Transforms that are contained in this Reference.
[中]返回一个java。util。集合#此[$0$]中包含的转换的不可修改列表。

代码示例

代码示例来源:origin: com.hynnet/xws-security

private static boolean isTransformsEqual(Reference ref1, Reference ref2) throws XWSSecurityException {
  List tList1 = ref1.getTransforms();
  
  List tList2 = ref2.getTransforms();
  if(tList1.size() != tList2.size()){
    logger.log(Level.SEVERE, "WSS1342.illegal.unmatched.transforms");
    throw new XWSSecurityException("Receiver Requirements for the transforms are not met");
    //return false;
  }else{
    int i=0;
    while(i< tList1.size()){
      Transform tr1 = (Transform)tList1.get(i);
      Transform tr2 = (Transform)tList2.get(i);
      
      String alg1 = tr1.getAlgorithm();
      String alg2 = tr2.getAlgorithm();
      i++;
      if(alg1 == alg2 || (alg1 != null && alg1.equals(alg2))){
        continue;
      }else{
        logger.log(Level.SEVERE, "WSS1342.illegal.unmatched.transforms");
        throw new XWSSecurityException("Receiver Requirements for the transforms are not met");
        //return false;
      }
      
    }
  }
  return true;
}

代码示例来源:origin: com.hynnet/xws-security

private static Data getData(Reference reference,DOMValidateContext context) throws Exception{
  
  final String uri = reference.getURI();
  URIReference uriRef = new URIReference(){
    public String getURI(){
      return uri;
    }
    
    public String getType(){
      return null;
    }
  };
  Data inputData = DSigResolver.getInstance().dereference(uriRef, context);
  if(inputData instanceof AttachmentData){
    return inputData;
  }
  List transformList = reference.getTransforms();
  Iterator itr = transformList.iterator();
  while(itr.hasNext()){
    Transform transform = (Transform)itr.next();
    inputData = getData(transform,inputData,context);
  }
  return inputData;
}

代码示例来源:origin: com.hynnet/xws-security

/**
 *
 * @param reference
 * @return Transform
 */
public SignatureTarget.Transform getSignatureTransform(Reference reference ){
  List transformList = reference.getTransforms();
  Iterator transformItr = transformList.iterator();
  SignatureTarget.Transform transform = null;
  while(transformItr.hasNext()){
    Transform trObj = (Transform)transformItr.next();
    String algorithm = trObj.getAlgorithm();
    transform = new SignatureTarget.Transform();
    transform.setTransform(algorithm);
    AlgorithmParameterSpec paramSpec = trObj.getParameterSpec();
    // ArrayList paramList = new HashMap();
    //  addCanonicalizationParams(paramSpec,paramList);
    transform.setAlgorithmParameters(paramSpec);
  }
  return transform;
}

代码示例来源:origin: org.apache.santuario/xmlsec

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof Reference)) {
    return false;
  }
  Reference oref = (Reference)o;
  boolean idsEqual = id == null ? oref.getId() == null
                  : id.equals(oref.getId());
  boolean urisEqual = uri == null ? oref.getURI() == null
                   : uri.equals(oref.getURI());
  boolean typesEqual = type == null ? oref.getType() == null
                    : type.equals(oref.getType());
  boolean digestValuesEqual =
    Arrays.equals(digestValue, oref.getDigestValue());
  return digestMethod.equals(oref.getDigestMethod()) && idsEqual &&
    urisEqual && typesEqual &&
    allTransforms.equals(oref.getTransforms()) && digestValuesEqual;
}

代码示例来源:origin: org.apache.ws.security/wss4j

WSDocInfo wsDocInfo
) throws WSSecurityException {
  List<?> transformsList = siRef.getTransforms();

代码示例来源:origin: org.apache.juddi/juddi-client

for (Object xform : ref.getTransforms()) {
    logger.debug("Transform: " + xform);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

WSDocInfo wsDocInfo
) throws WSSecurityException {
  List<?> transformsList = siRef.getTransforms();

代码示例来源:origin: org.apache.juddi/uddi-tck-base

System.out.println("ref[" + j + "] validity status: " + refValid);
System.out.println("Ref type: " + ref.getType() + ", URI: " + ref.getURI());
for (Object xform : ref.getTransforms()) {
  System.out.println("Transform: " + xform);

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom

) throws WSSecurityException {
  for (Object transformObject : siRef.getTransforms()) {

代码示例来源:origin: es.gob.afirma/afirma-crypto-xmlsignature

for (final Object t : r.getTransforms()) {
  if (t instanceof Transform) {
    if (!"http://www.w3.org/2000/09/xmldsig#base64".equals(((Transform) t).getAlgorithm())) { //$NON-NLS-1$

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

for (int i = 0; i < reference.getTransforms().size(); i++) {
  Transform transform = (Transform)reference.getTransforms().get(i);
  String algorithm = transform.getAlgorithm();
  Set<String> allowedTransformAlgorithms =

代码示例来源:origin: com.hynnet/xws-security

canonicalizer.setStream(new ByteArrayOutputStream());
List trList = ref.getTransforms();
if(trList.size() >1){
  logger.log(Level.SEVERE, LogStringsMessages.WSS_1714_UNSUPPORTED_TRANSFORM_ERROR());

代码示例来源:origin: org.apache.ws.security/wss4j

for (int i = 0; i < reference.getTransforms().size(); i++) {
  Transform transform = (Transform)reference.getTransforms().get(i);
  String algorithm = transform.getAlgorithm();
  Set<String> allowedTransformAlgorithms =

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

for (int i = 0; i < reference.getTransforms().size(); i++) {
  Transform transform = (Transform)reference.getTransforms().get(i);
  String algorithm = transform.getAlgorithm();
  Set<String> allowedTransformAlgorithms =

代码示例来源:origin: org.apache.ws.security/wss4j

List<Transform> transforms = (List<Transform>)siRef.getTransforms();
List<String> transformAlgorithms = new ArrayList<String>(transforms.size());
for (Transform transform : transforms) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

List<Transform> transforms = (List<Transform>)siRef.getTransforms();
List<String> transformAlgorithms = new ArrayList<String>(transforms.size());
for (Transform transform : transforms) {

代码示例来源:origin: org.apache.ws.security/wss4j

List<Transform> transforms = (List<Transform>)reference.getTransforms();
List<String> transformAlgorithms = new ArrayList<String>(transforms.size());
for (Transform transform : transforms) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

List<Transform> transforms = (List<Transform>)reference.getTransforms();
List<String> transformAlgorithms = new ArrayList<String>(transforms.size());
for (Transform transform : transforms) {

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom

List<Transform> transforms = (List<Transform>)siRef.getTransforms();
List<String> transformAlgorithms = new ArrayList<>(transforms.size());
for (Transform transform : transforms) {

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom

List<Transform> transforms = (List<Transform>)reference.getTransforms();
List<String> transformAlgorithms = new ArrayList<>(transforms.size());
for (Transform transform : transforms) {

相关文章