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


Java OctetStreamData类代码示例

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


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

示例1: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
@Override
public Data dereference(URIReference arg0, XMLCryptoContext arg1)
		throws URIReferenceException {

	String partPath = arg0.getURI().toString();
	System.out.println(partPath + " in package ? "
			+ odfDoc.getPackage().contains(partPath));

	// see if our document contains this part, if not dereference using
	// default dereferencer
	if (!odfDoc.getPackage().contains(partPath)) {
		return defaultURIDereferencer.dereference(arg0, arg1);
	}

	// return part content as octet stream data
	InputStream is = odfDoc.getPackage().getInputStream(partPath);
	OctetStreamData retData = new OctetStreamData(is);

	return retData;

}
 
开发者ID:y12studio,项目名称:bkbc-premature,代码行数:22,代码来源:HelloOdfSign.java

示例2: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:ValidationTests.java

示例3: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ErrorHandlerPermissions.java

示例4: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
public Data dereference(URIReference uriReference, XMLCryptoContext context)
    throws URIReferenceException {
    String uri = uriReference.getURI();
    if (uriMap.containsKey(uri)) {
        try {
            FileInputStream fis = new FileInputStream(uriMap.get(uri));
            return new OctetStreamData(
                fis, uriReference.getURI(), uriReference.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return ud.dereference(uriReference, context);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:15,代码来源:LocalHttpCacheURIDereferencer.java

示例5: toOctetStreamData

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
private OctetStreamData toOctetStreamData(Node node) throws TransformerException {
	Source source = new DOMSource(node);
	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
	Result result = new StreamResult(outputStream);
	TransformerFactory transformerFactory = TransformerFactory.newInstance();
	Transformer transformer = transformerFactory.newTransformer();
	transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
	transformer.transform(source, result);
	LOG.debug("result: " + new String(outputStream.toByteArray()));
	return new OctetStreamData(new ByteArrayInputStream(outputStream.toByteArray()));
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:12,代码来源:RelationshipTransformService.java

示例6: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
public Data dereference(URIReference uriReference, XMLCryptoContext xmlCryptoContext)
		throws URIReferenceException {
	String uri = uriReference.getURI();
	byte[] data = this.resources.get(uri);
	if (null == data) {
		return null;
	}
	return new OctetStreamData(new ByteArrayInputStream(data));
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:10,代码来源:AbstractXmlSignatureServiceTest.java

示例7: validate

import javax.xml.crypto.OctetStreamData; //导入依赖的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

示例8: dereference

import javax.xml.crypto.OctetStreamData; //导入依赖的package包/类
public Data dereference(URIReference ref, XMLCryptoContext ctxt) {
    return new OctetStreamData(new ByteArrayInputStream(data));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:4,代码来源:TestUtils.java


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