當前位置: 首頁>>代碼示例>>Java>>正文


Java DigiDocException.handleException方法代碼示例

本文整理匯總了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;
     }
 }
 
開發者ID:aleksz,項目名稱:driveddoc,代碼行數:17,代碼來源:DigidocOCSPSignatureContainer.java

示例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);
    }
}
 
開發者ID:aleksz,項目名稱:driveddoc,代碼行數:29,代碼來源:FlexibleBouncyCastleNotaryFactory.java

示例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;
    }
}
 
開發者ID:aleksz,項目名稱:driveddoc,代碼行數:13,代碼來源:DigidocOCSPSignatureContainer.java

示例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;
    }
}
 
開發者ID:aleksz,項目名稱:driveddoc,代碼行數:9,代碼來源:DigidocOCSPSignatureContainer.java

示例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;
}
 
開發者ID:aleksz,項目名稱:driveddoc,代碼行數:43,代碼來源:MobileIdService.java


注:本文中的ee.sk.digidoc.DigiDocException.handleException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。