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


Java TransformService类代码示例

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


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

示例1: main

import javax.xml.crypto.dsig.TransformService; //导入依赖的package包/类
public static void main(String[] args) throws NoSuchAlgorithmException {
   try {
       TransformService ts = TransformService.getInstance(
           Transform.BASE64, "DOM", "SomeProviderThatDoesNotExist");
   }
   catch(NoSuchProviderException e) {
       // this is expected
   }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:UnknownProvider.java

示例2: DOMTransform

import javax.xml.crypto.dsig.TransformService; //导入依赖的package包/类
/**
 * Creates a <code>DOMTransform</code> from an element. It unmarshals any
 * algorithm-specific input parameters.
 *
 * @param transElem a Transform element
 */
public DOMTransform(Element transElem, XMLCryptoContext context,
                    Provider provider)
    throws MarshalException
{
    String algorithm = DOMUtils.getAttributeValue(transElem, "Algorithm");
    if (provider == null) {
        try {
            spi = TransformService.getInstance(algorithm, "DOM");
        } catch (NoSuchAlgorithmException e1) {
            throw new MarshalException(e1);
        }
    } else {
        try {
            spi = TransformService.getInstance(algorithm, "DOM", provider);
        } catch (NoSuchAlgorithmException nsae) {
            try {
                spi = TransformService.getInstance(algorithm, "DOM");
            } catch (NoSuchAlgorithmException e2) {
                throw new MarshalException(e2);
            }
        }
    }
    try {
        spi.init(new javax.xml.crypto.dom.DOMStructure(transElem), context);
    } catch (InvalidAlgorithmParameterException iape) {
        throw new MarshalException(iape);
    }
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:35,代码来源:DOMTransform.java

示例3: newTransform

import javax.xml.crypto.dsig.TransformService; //导入依赖的package包/类
public Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
	TransformService spi;
	try {
	    spi = TransformService.getInstance(algorithm, "DOM");
	} catch (NoSuchAlgorithmException nsae) {
	    spi = TransformService.getInstance(algorithm, "DOM", getProvider());
	}
	if (params == null) {
	    spi.init(null);
	} else {
	    spi.init(params, null);
	}
	return new DOMTransform(spi);
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:15,代码来源:DOMXMLSignatureFactory.java

示例4: dsig

import javax.xml.crypto.dsig.TransformService; //导入依赖的package包/类
public void dsig() throws Exception {

        Provider p = Security.getProvider("ApacheXMLDSig");
        TransformService.getInstance(Transform.XPATH, "DOM", p);
    }
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:6,代码来源:AppB.java


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