当前位置: 首页>>代码示例>>Java>>正文


Java Transforms类代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.security.transforms.Transforms的典型用法代码示例。如果您正苦于以下问题:Java Transforms类的具体用法?Java Transforms怎么用?Java Transforms使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Transforms类属于com.sun.org.apache.xml.internal.security.transforms包,在下文中一共展示了Transforms类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDocument

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * This <code>addDocument</code> method is used to add a new resource to the
 * signed info. A {@link com.sun.org.apache.xml.internal.security.signature.Reference} is built
 * from the supplied values.
 *
 * @param baseURI the URI of the resource where the XML instance was stored
 * @param referenceURI <code>URI</code> attribute in <code>Reference</code> for specifying
 * where data is
 * @param transforms com.sun.org.apache.xml.internal.security.signature.Transforms object with an ordered
 * list of transformations to be performed.
 * @param digestURI The digest algorithm URI to be used.
 * @param referenceId
 * @param referenceType
 * @throws XMLSignatureException
 */
public void addDocument(
    String baseURI, String referenceURI, Transforms transforms,
    String digestURI, String referenceId, String referenceType
) throws XMLSignatureException {
    // the this.doc is handed implicitly by the this.getOwnerDocument()
    Reference ref =
        new Reference(this.doc, baseURI, referenceURI, this, transforms, digestURI);

    if (referenceId != null) {
        ref.setId(referenceId);
    }

    if (referenceType != null) {
        ref.setType(referenceType);
    }

    // add Reference object to our cache vector
    this.references.add(ref);

    // add the Element of the Reference object to the Manifest/SignedInfo
    this.constructionElement.appendChild(ref.getElement());
    XMLUtils.addReturnToElement(this.constructionElement);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:Manifest.java

示例2: Reference

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Build a {@link Reference} from an {@link Element}
 *
 * @param element <code>Reference</code> element
 * @param baseURI the URI of the resource where the XML instance was stored
 * @param manifest is the {@link Manifest} of {@link SignedInfo} in which the Reference occurs.
 * @param secureValidation whether secure validation is enabled or not
 * We need this because the Manifest has the individual {@link ResourceResolver}s which have
 * been set by the user
 * @throws XMLSecurityException
 */
protected Reference(Element element, String baseURI, Manifest manifest, boolean secureValidation)
    throws XMLSecurityException {
    super(element, baseURI);
    this.secureValidation = secureValidation;
    this.baseURI = baseURI;
    Element el = XMLUtils.getNextElement(element.getFirstChild());
    if (Constants._TAG_TRANSFORMS.equals(el.getLocalName())
        && Constants.SignatureSpecNS.equals(el.getNamespaceURI())) {
        transforms = new Transforms(el, this.baseURI);
        transforms.setSecureValidation(secureValidation);
        if (secureValidation && transforms.getLength() > MAXIMUM_TRANSFORM_COUNT) {
            Object exArgs[] = { transforms.getLength(), MAXIMUM_TRANSFORM_COUNT };

            throw new XMLSecurityException("signature.tooManyTransforms", exArgs);
        }
        el = XMLUtils.getNextElement(el.getNextSibling());
    }
    digestMethodElem = el;
    digestValueElement = XMLUtils.getNextElement(digestMethodElem.getNextSibling());
    this.manifest = manifest;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:Reference.java

示例3: resolveInput

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Resolves the input from the given retrieval method
 * @return
 * @throws XMLSecurityException
 */
private static XMLSignatureInput resolveInput(
    RetrievalMethod rm, String baseURI, boolean secureValidation
) throws XMLSecurityException {
    Attr uri = rm.getURIAttr();
    // Apply the transforms
    Transforms transforms = rm.getTransforms();
    ResourceResolver resRes = ResourceResolver.getInstance(uri, baseURI, secureValidation);
    XMLSignatureInput resource = resRes.resolve(uri, baseURI, secureValidation);
    if (transforms != null) {
        if (log.isLoggable(java.util.logging.Level.FINE)) {
            log.log(java.util.logging.Level.FINE, "We have Transforms");
        }
        resource = transforms.performTransforms(resource);
    }
    return resource;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:RetrievalMethodResolver.java

示例4: getTransforms

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Method getTransforms
 *
 * @throws XMLSecurityException
 * @return the transformations
 */
public Transforms getTransforms() throws XMLSecurityException {
    try {
        Element transformsElem =
            XMLUtils.selectDsNode(
                this.constructionElement.getFirstChild(), Constants._TAG_TRANSFORMS, 0);

        if (transformsElem != null) {
            return new Transforms(transformsElem, this.baseURI);
        }

        return null;
    } catch (XMLSignatureException ex) {
        throw new XMLSecurityException("empty", ex);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:RetrievalMethod.java

示例5: addDocument

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * This <code>addDocument</code> method is used to add a new resource to the
 * signed info. A {@link com.sun.org.apache.xml.internal.security.signature.Reference} is built
 * from the supplied values.
 *
 * @param BaseURI the URI of the resource where the XML instance was stored
 * @param referenceURI <code>URI</code> attribute in <code>Reference</code> for specifing where data is
 * @param transforms com.sun.org.apache.xml.internal.security.signature.Transforms object with an ordered list of transformations to be performed.
 * @param digestURI The digest algorthim URI to be used.
 * @param ReferenceId
 * @param ReferenceType
 * @throws XMLSignatureException
 */
public void addDocument(
        String BaseURI, String referenceURI, Transforms transforms, String digestURI, String ReferenceId, String ReferenceType)
           throws XMLSignatureException {

      // the this._doc is handed implicitly by the this.getOwnerDocument()
      Reference ref = new Reference(this._doc, BaseURI, referenceURI, this,
                                    transforms, digestURI);

      if (ReferenceId != null) {
         ref.setId(ReferenceId);
      }

      if (ReferenceType != null) {
         ref.setType(ReferenceType);
      }

      // add Reference object to our cache vector
      this._references.add(ref);

      // add the Element of the Reference object to the Manifest/SignedInfo
      this._constructionElement.appendChild(ref.getElement());
      XMLUtils.addReturnToElement(this._constructionElement);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:37,代码来源:Manifest.java

示例6: Reference

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Build a {@link Reference} from an {@link Element}
 *
 * @param element <code>Reference</code> element
 * @param BaseURI the URI of the resource where the XML instance was stored
 * @param manifest is the {@link Manifest} of {@link SignedInfo} in which the Reference occurs. We need this because the Manifest has the individual {@link ResourceResolver}s whcih have been set by the user
 * @throws XMLSecurityException
 */
protected Reference(Element element, String BaseURI, Manifest manifest)
        throws XMLSecurityException {

   super(element, BaseURI);
   this._baseURI=BaseURI;
   Element el=XMLUtils.getNextElement(element.getFirstChild());
   if (Constants._TAG_TRANSFORMS.equals(el.getLocalName()) &&
               Constants.SignatureSpecNS.equals(el.getNamespaceURI())) {
       transforms = new Transforms(el,this._baseURI);
       el=XMLUtils.getNextElement(el.getNextSibling());
   }
   digestMethodElem = el;
   digestValueElement =XMLUtils.getNextElement(digestMethodElem.getNextSibling());;
   this._manifest = manifest;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:Reference.java

示例7: resolveInput

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Resolves the input from the given retrieval method
 * @return
 * @throws XMLSecurityException
 */
static private XMLSignatureInput resolveInput(RetrievalMethod rm,String BaseURI) throws XMLSecurityException{
    Attr uri = rm.getURIAttr();
        //Apply the trnasforms
    Transforms transforms = rm.getTransforms();
    ResourceResolver resRes = ResourceResolver.getInstance(uri, BaseURI);
    if (resRes != null) {
       XMLSignatureInput resource = resRes.resolve(uri, BaseURI);
       if (transforms != null) {
               log.log(java.util.logging.Level.FINE, "We have Transforms");
                       resource = transforms.performTransforms(resource);
       }
               return resource;
    }
        return null;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:21,代码来源:RetrievalMethodResolver.java

示例8: RetrievalMethod

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Constructor RetrievalMethod
 *
 * @param doc
 * @param URI
 * @param transforms
 * @param Type
 */
public RetrievalMethod(Document doc, String URI, Transforms transforms,
                       String Type) {

   super(doc);

   this._constructionElement.setAttributeNS(null, Constants._ATT_URI, URI);

   if (Type != null) {
      this._constructionElement.setAttributeNS(null, Constants._ATT_TYPE, Type);
   }

   if (transforms != null) {
      this._constructionElement.appendChild(transforms.getElement());
      XMLUtils.addReturnToElement(this._constructionElement);
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:25,代码来源:RetrievalMethod.java

示例9: getTransforms

import com.sun.org.apache.xml.internal.security.transforms.Transforms; //导入依赖的package包/类
/**
 * Method getTransforms
 *
 *
 * @throws XMLSecurityException
 * @return the transforamitons
 */
public Transforms getTransforms() throws XMLSecurityException {

   try {
    Element transformsElem =
          XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                                             Constants
                                                ._TAG_TRANSFORMS, 0);

      if (transformsElem != null) {
         return new Transforms(transformsElem, this._baseURI);
      }

      return null;
   } catch (XMLSignatureException ex) {
      throw new XMLSecurityException("empty", ex);
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:25,代码来源:RetrievalMethod.java


注:本文中的com.sun.org.apache.xml.internal.security.transforms.Transforms类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。