以编程方式发现java无限加密 [英] programmatically discover java unlimited encryption

查看:245
本文介绍了以编程方式发现java无限加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java应用程序,需要安装JCE Unlimited Strength策略文件才能生成证书。但是,目前,如果没有安装文件,系统会无声地失败,而不是抛出异常等。

I have a Java app that requires JCE Unlimited Strength policy files to be installed in order to generate certificates. However, currently, the system fails silently if the files are not installed, rather than throwing an exception or something.

是否有一种编程方式从内部检查这些文件应用程序?谢谢。

Is there a programmatic way to check for these files from within the app? thanks.

推荐答案

正如GregS指出的那样,程序没有以默默方式失败,而是吞噬了异常。对 KeyStore.store()的调用抛出了一个 IOException ,我正在使用泛型 catch(例外e)更远。一旦单独捕获 IOException ,该程序现在可以正常工作。

Turns out, as GregS points out above, that the program was not failing silently, but swallowing the exception. The call to KeyStore.store() was throwing an IOException that I was catching with a generic catch (Exception e) farther below. Once catching the IOException separately, the program now works properly.

这篇关于以编程方式发现java无限加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆