本文整理匯總了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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}