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


Java NoSuchAlgorithmException.getCause方法代碼示例

本文整理匯總了Java中java.security.NoSuchAlgorithmException.getCause方法的典型用法代碼示例。如果您正苦於以下問題:Java NoSuchAlgorithmException.getCause方法的具體用法?Java NoSuchAlgorithmException.getCause怎麽用?Java NoSuchAlgorithmException.getCause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.security.NoSuchAlgorithmException的用法示例。


在下文中一共展示了NoSuchAlgorithmException.getCause方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleException

import java.security.NoSuchAlgorithmException; //導入方法依賴的package包/類
private static CertStore handleException(NoSuchAlgorithmException e)
        throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
    Throwable cause = e.getCause();
    if (cause instanceof InvalidAlgorithmParameterException) {
        throw (InvalidAlgorithmParameterException)cause;
    }
    throw e;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:CertStore.java

示例2: handleException

import java.security.NoSuchAlgorithmException; //導入方法依賴的package包/類
private static Configuration handleException(NoSuchAlgorithmException nsae)
            throws NoSuchAlgorithmException {
    Throwable cause = nsae.getCause();
    if (cause instanceof IllegalArgumentException) {
        throw (IllegalArgumentException)cause;
    }
    throw nsae;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:Configuration.java

示例3: getTerminalFactory

import java.security.NoSuchAlgorithmException; //導入方法依賴的package包/類
static TerminalFactory getTerminalFactory(String provName) throws Exception {
    try {
        TerminalFactory factory = (provName == null)
                ? TerminalFactory.getInstance("PC/SC", null)
                : TerminalFactory.getInstance("PC/SC", null, provName);
        System.out.println(factory);
        return factory;
    } catch (NoSuchAlgorithmException e) {
        Throwable cause = e.getCause();
        if (cause != null && cause.getMessage().startsWith("PC/SC not available")) {
            return null;
        }
        throw e;
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:16,代碼來源:Utils.java

示例4: getTerminal

import java.security.NoSuchAlgorithmException; //導入方法依賴的package包/類
static CardTerminal getTerminal(String[] args, String provider) throws Exception {
    setLibrary(args);

    try {
        TerminalFactory factory = (provider == null)
                ? TerminalFactory.getInstance("PC/SC", null)
                : TerminalFactory.getInstance("PC/SC", null, provider);
        System.out.println(factory);

        List<CardTerminal> terminals = factory.terminals().list();
        System.out.println("Terminals: " + terminals);
        if (terminals.isEmpty()) {
            return null;
        }
        CardTerminal terminal = terminals.get(0);

        if (terminal.isCardPresent() == false) {
            System.out.println("*** Insert card");
            if (terminal.waitForCardPresent(20 * 1000) == false) {
                throw new Exception("no card available");
            }
        }
        System.out.println("card present: " + terminal.isCardPresent());

        return terminal;

    } catch (NoSuchAlgorithmException e) {
        Throwable cause = e.getCause();
        if (cause != null && cause.getMessage().startsWith("PC/SC not available")) {
            return null;
        }
        throw e;
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:35,代碼來源:Utils.java

示例5: handleException

import java.security.NoSuchAlgorithmException; //導入方法依賴的package包/類
private static CertStore handleException(NoSuchAlgorithmException e)
        throws NoSuchAlgorithmException,
        InvalidAlgorithmParameterException {
    Throwable cause = e.getCause();
    if (cause instanceof InvalidAlgorithmParameterException) {
        throw (InvalidAlgorithmParameterException)cause;
    }
    throw e;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:CertStore.java


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