本文整理汇总了Java中ee.sk.digidoc.DigiDocException.handleException方法的典型用法代码示例。如果您正苦于以下问题:Java DigiDocException.handleException方法的具体用法?Java DigiDocException.handleException怎么用?Java DigiDocException.handleException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ee.sk.digidoc.DigiDocException
的用法示例。
在下文中一共展示了DigiDocException.handleException方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findAlias
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private String findAlias(KeyStore store) throws DigiDocException {
try {
java.util.Enumeration en = store.aliases();
// find the key alias
while(en.hasMoreElements()) {
String n = (String)en.nextElement();
if (store.isKeyEntry(n)) {
return n;
}
}
return null;
} catch(Exception ex) {
DigiDocException.handleException(ex, DigiDocException.ERR_NOT_FAC_INIT);
return null;
}
}
示例2: init
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
/**l
* initializes the implementation class
*/
public void init()
throws DigiDocException
{
try {
String proxyHost = ConfigManager.instance().
getProperty("DIGIDOC_PROXY_HOST");
String proxyPort = ConfigManager.instance().
getProperty("DIGIDOC_PROXY_PORT");
if(proxyHost != null && proxyPort != null) {
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", proxyPort);
}
String sigFlag = ConfigManager.instance().getProperty("SIGN_OCSP_REQUESTS");
m_bSignRequests = (sigFlag != null && sigFlag.equals("true"));
// only need this if we must sign the requests
Provider prv = (Provider)Class.forName(ConfigManager.
instance().getProperty("DIGIDOC_SECURITY_PROVIDER")).newInstance();
//System.out.println("Provider");
//prv.list(System.out);
Security.addProvider(prv);
} catch(Exception ex) {
DigiDocException.handleException(ex, DigiDocException.ERR_NOT_FAC_INIT);
}
}
示例3: loadStore
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private KeyStore loadStore(InputStream in, String pass) throws DigiDocException {
try {
KeyStore store = KeyStore.getInstance("PKCS12", "BC");
store.load(in, pass.toCharArray());
return store;
} catch(Exception ex) {
DigiDocException.handleException(ex, DigiDocException.ERR_NOT_FAC_INIT);
return null;
}
}
示例4: getSignKey
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private PrivateKey getSignKey(KeyStore store, String alias) throws DigiDocException {
try {
return (PrivateKey)store.getKey(alias, null);
} catch(Exception ex) {
DigiDocException.handleException(ex, DigiDocException.ERR_NOT_FAC_INIT);
return null;
}
}
示例5: getStatus
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public String getStatus(SignedDoc sdoc, String sSesscode)
throws DigiDocException {
String sStatus = null;
if (sdoc == null)
throw new DigiDocException(DigiDocException.ERR_DIGIDOC_SERVICE,
"Missing SignedDoc object", null);
if (sSesscode == null || sSesscode.trim().length() == 0)
throw new DigiDocException(DigiDocException.ERR_DIGIDOC_SERVICE,
"Missing or invalid session code", null);
// compose soap msg
StringBuffer sbMsg = new StringBuffer(g_xmlHdr2);
addElem(sbMsg, "Sesscode", sSesscode);
addElem(sbMsg, "WaitSignature", "false");
sbMsg.append(g_xmlEnd2);
// send soap message
LOG.fine("Sending:\n---\n" + sbMsg.toString() + "\n---\n");
String sResp = pullUrl(sbMsg.toString());
LOG.fine("Received:\n---\n" + sResp + "\n---\n");
if (sResp != null && sResp.trim().length() > 0) {
sStatus = findElemValue(sResp, "Status");
if (sStatus != null && sStatus.equals(STAT_SIGNATURE)) {
String s = findElemValue(sResp, "Signature");
if (s != null) {
String sSig = ConvertUtils.unescapeXmlSymbols(s);
String sId = findAttrValue(sSig, "Id");
LOG.fine("Signature: " + sId + "\n---\n" + sSig + "\n---\n");
Signature sig = new Signature(sdoc);
sig.setId(sId);
try {
sig.setOrigContent(sSig.getBytes("UTF-8"));
} catch (Exception ex) {
LOG.warning("Error adding signature: " + ex);
DigiDocException.handleException(ex,
DigiDocException.ERR_DIGIDOC_SERVICE);
}
sdoc.addSignature(sig);
}
}
}
return sStatus;
}