本文整理汇总了Java中javax.xml.crypto.dsig.dom.DOMSignContext.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java DOMSignContext.getParent方法的具体用法?Java DOMSignContext.getParent怎么用?Java DOMSignContext.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.crypto.dsig.dom.DOMSignContext
的用法示例。
在下文中一共展示了DOMSignContext.getParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transform
import javax.xml.crypto.dsig.dom.DOMSignContext; //导入方法依赖的package包/类
/**
* Transforms the specified data using the underlying transform algorithm.
* This method invokes the {@link #marshal marshal} method and passes it
* the specified <code>DOMSignContext</code> before transforming the data.
*
* @param data the data to be transformed
* @param sc the <code>XMLCryptoContext</code> containing
* additional context (may be <code>null</code> if not applicable)
* @param context the marshalling context
* @return the transformed data
* @throws MarshalException if an exception occurs while marshalling
* @throws NullPointerException if <code>data</code> or <code>context</code>
* is <code>null</code>
* @throws XMLSignatureException if an unexpected error occurs while
* executing the transform
*/
Data transform(Data data, XMLCryptoContext xc, DOMSignContext context)
throws MarshalException, TransformException
{
Node parent = context.getParent();
XmlWriter xwriter = new XmlWriterToTree(Marshaller.getMarshallers(), parent);
marshal(xwriter, DOMUtils.getSignaturePrefix(context), context);
return transform(data, xc);
}