本文整理汇总了Java中org.apache.xml.security.exceptions.XMLSecurityException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java XMLSecurityException.getMessage方法的具体用法?Java XMLSecurityException.getMessage怎么用?Java XMLSecurityException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xml.security.exceptions.XMLSecurityException
的用法示例。
在下文中一共展示了XMLSecurityException.getMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEnvelope
import org.apache.xml.security.exceptions.XMLSecurityException; //导入方法依赖的package包/类
/**
* Set the envelope to host the Signature element. That is the
* XML document where the Signature element to be added. The
* digital signature here will always be an enveloped signature.
* The envelope will be included in the process of signing.
*
* @param doc the XML document to host the Signature element
* @param algo the algorithm used for digital signature. Currently, only
* two values are tested: <code>dsa-sha1</code> and
* <code>rsa-sha1</code>.
* @throws SignException internal exception when doing initialization
* on Apache XML Security library
*/
public void setEnvelope(Document doc, String algo) throws SignException {
envelope = doc;
try {
if (algo != null) {
signature = new XMLSignature(envelope, NAMESPACE_URI_DS,
NAMESPACE_URI_DS + algo);
}
} catch (XMLSecurityException e) {
String err = "Cannot create XMLSignature object - "
+ e.getMessage();
logger.error(err);
throw new SignException(err);
}
this.algo = algo;
logger.debug("setEnvelope, using algorithm: " + algo);
}