本文整理汇总了Java中java.security.KeyStore.LoadStoreParameter方法的典型用法代码示例。如果您正苦于以下问题:Java KeyStore.LoadStoreParameter方法的具体用法?Java KeyStore.LoadStoreParameter怎么用?Java KeyStore.LoadStoreParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.KeyStore
的用法示例。
在下文中一共展示了KeyStore.LoadStoreParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: engineLoad
import java.security.KeyStore; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void engineLoad(final KeyStore.LoadStoreParameter param) throws IOException {
if (param != null) {
final ProtectionParameter pp = param.getProtectionParameter();
if (pp instanceof KeyStore.CallbackHandlerProtection) {
if (((KeyStore.CallbackHandlerProtection) pp).getCallbackHandler() == null) {
throw new IllegalArgumentException("El CallbackHandler no puede ser nulo"); //$NON-NLS-1$
}
this.cryptoCard = new Ceres(
CeresProvider.getDefaultApduConnection(),
new JseCryptoHelper()
);
this.cryptoCard.setCallbackHandler(((KeyStore.CallbackHandlerProtection) pp).getCallbackHandler());
}
else if (pp instanceof KeyStore.PasswordProtection) {
final PasswordCallback pwc = new CeresPasswordCallback((PasswordProtection) pp);
this.cryptoCard = new Ceres(
CeresProvider.getDefaultApduConnection(),
new JseCryptoHelper()
);
this.cryptoCard.setPasswordCallback(pwc);
}
else {
Logger.getLogger("es.gob.jmulticard").warning( //$NON-NLS-1$
"Se ha proporcionado un LoadStoreParameter de tipo no soportado, se ignorara: " + (pp != null ? pp.getClass().getName() : "NULO") //$NON-NLS-1$ //$NON-NLS-2$
);
}
}
else {
this.cryptoCard = new Ceres(
CeresProvider.getDefaultApduConnection(),
new JseCryptoHelper()
);
}
userCertAliases = Arrays.asList(this.cryptoCard.getAliases());
}
示例2: engineLoad
import java.security.KeyStore; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void engineLoad(final KeyStore.LoadStoreParameter param) throws IOException {
if (param != null) {
final ProtectionParameter pp = param.getProtectionParameter();
if (pp instanceof KeyStore.CallbackHandlerProtection) {
if (((KeyStore.CallbackHandlerProtection) pp).getCallbackHandler() == null) {
throw new IllegalArgumentException("El CallbackHandler no puede ser nulo"); //$NON-NLS-1$
}
this.cryptoCard = DnieFactory.getDnie(
DnieProvider.getDefaultApduConnection(),
null,
new JseCryptoHelper(),
((KeyStore.CallbackHandlerProtection) pp).getCallbackHandler()
);
}
else if (pp instanceof KeyStore.PasswordProtection) {
final PasswordCallback pwc = new DniePasswordCallback((PasswordProtection) pp);
this.cryptoCard = DnieFactory.getDnie(
DnieProvider.getDefaultApduConnection(),
pwc,
new JseCryptoHelper(),
null
);
}
else {
LOGGER.warning(
"Se ha proporcionado un LoadStoreParameter de tipo no soportado, se ignorara: " + (pp != null ? pp.getClass().getName() : "NULO") //$NON-NLS-1$ //$NON-NLS-2$
);
}
}
else {
this.cryptoCard = DnieFactory.getDnie(
DnieProvider.getDefaultApduConnection(),
null,
new JseCryptoHelper(),
null
);
}
this.aliases = Arrays.asList(this.cryptoCard.getAliases());
}