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


Java XMLValidateContext类代码示例

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


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

示例1: getXMLValidateContext

import javax.xml.crypto.dsig.XMLValidateContext; //导入依赖的package包/类
public static XMLValidateContext getXMLValidateContext(String type,
                                                   File input,
                                                   String tag)
    throws Exception {
    if (type.equalsIgnoreCase("dom")) {
        DocumentBuilder docBuilder = XMLUtils.createDocumentBuilder(false, false);
        Document doc = docBuilder.parse(input);
        if (tag == null) {
            return new DOMValidateContext
                (TestUtils.getPublicKey("RSA", 512),
                 doc.getDocumentElement());
        } else {
            NodeList list = doc.getElementsByTagName(tag);
            return new DOMValidateContext
                (TestUtils.getPublicKey("RSA", 512), list.item(0));
        }
    } else {
        throw new Exception("Unsupported XMLValidateContext type: " + type);
    }
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:21,代码来源:TestUtils.java

示例2: validate

import javax.xml.crypto.dsig.XMLValidateContext; //导入依赖的package包/类
public boolean validate(XMLValidateContext vCtx)
    throws XMLSignatureException {
    this.dis = new ByteArrayInputStream(id.getBytes());
    this.derefData = new OctetStreamData(this.dis);
    return status;
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:7,代码来源:TestUtils.java

示例3: unmarshalXMLSignature

import javax.xml.crypto.dsig.XMLValidateContext; //导入依赖的package包/类
public XMLSignature unmarshalXMLSignature(XMLValidateContext context) throws MarshalException {
	throw new UnsupportedOperationException();
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:4,代码来源:DOMXMLSignatureFactory.java

示例4: verify

import javax.xml.crypto.dsig.XMLValidateContext; //导入依赖的package包/类
/**
 * Verifies the passed-in signature with the specified key, using the
 * underlying Signature or Mac algorithm.
 *
 * @param key the verification key
 * @param si the SignedInfo
 * @param sig the signature bytes to be verified
 * @param context the XMLValidateContext
 * @return <code>true</code> if the signature verified successfully,
 *    <code>false</code> if not
 * @throws NullPointerException if <code>key</code>, <code>si</code> or
 *    <code>sig</code> are <code>null</code>
 * @throws InvalidKeyException if the key is improperly encoded, of
 *    the wrong type, or parameters are missing, etc
 * @throws SignatureException if an unexpected error occurs, such
 *    as the passed in signature is improperly encoded
 * @throws XMLSignatureException if an unexpected error occurs
 */
abstract boolean verify(Key key, SignedInfo si, byte[] sig,
                        XMLValidateContext context)
    throws InvalidKeyException, SignatureException, XMLSignatureException;
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:AbstractDOMSignatureMethod.java

示例5: verify

import javax.xml.crypto.dsig.XMLValidateContext; //导入依赖的package包/类
/**
 * Verifies the passed-in signature with the specified key, using the
 * underlying Signature or Mac algorithm.
 *
 * @param key the verification key
 * @param si the SignedInfo
 * @param sig the signature bytes to be verified
 * @param context the XMLValidateContext
 * @return <code>true</code> if the signature verified successfully,
 *    <code>false</code> if not
 * @throws NullPointerException if <code>key</code>, <code>si</code> or
 *    <code>sig</code> are <code>null</code>
 * @throws InvalidKeyException if the key is improperly encoded, of
 *    the wrong type, or parameters are missing, etc
 * @throws SignatureException if an unexpected error occurs, such
 *    as the passed in signature is improperly encoded
 * @throws XMLSignatureException if an unexpected error occurs
 */
abstract boolean verify(Key key, DOMSignedInfo si, byte[] sig,
                        XMLValidateContext context)
    throws InvalidKeyException, SignatureException, XMLSignatureException;
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:22,代码来源:AbstractDOMSignatureMethod.java


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