在 IBM SDK 之上使用 Sun JCE 提供程序

发布于 2024-07-27 14:20:53 字数 469 浏览 2 评论 0原文

我需要在 IBM Websphere 上运行的应用程序中使用 Sun JCE 提供程序。 这可以通过指定 security_provider.1=com.sun.crypto.provider.SunJCE 来实现。 我的应用程序的某些部分使用了 IBM 的 SSL 设施。

我想知道配置 SunJCE 提供程序是否会影响应用程序其他部分中 JSSE 提供程序的使用。

我想问的另一个问题是,有什么方法可以继续使用 IBM JDK 默认值(JCE< JSSE 等)并在需要时仅使用 Sun JCE。 我的意思是我将把 Sun JCE Provider 配置为最后一个 security_provider.10。 在我需要使用 Sun JCE 提供程序的代码库中,我将在我的加密相关类中显式提供提供程序名称。 对于前 Cipher cip = Cipher.getInstance("DES","Sun")..

请让我知道哪一个是最好的方法。

I need to use Sun JCE provider in an application that is running on IBM Websphere. This can be achieved by specifying the security_provider.1=com.sun.crypto.provider.SunJCE.
Some parts of my application make use of SSL facilities of IBM.

I want to know whether configuring the SunJCE provider affects the JSSE provider usage in other parts of my application.

The other question I wanted to ask is, is there any way I can continue using IBM JDK defaults (JCE< JSSE and other) and use only Sun JCE wherever required. I mean I will configure Sun JCE Provider as the last one security_provider.10. And in the code base where I need to use Sun JCE provider, I will explicitly provide the provider name in my Crypto related classes. For ex Cipher cip = Cipher.getInstance("DES","Sun")..

Please let me know which is the best way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反目相谮 2024-08-03 14:20:53

要指定安全提供程序,您应该按照您所说的进行操作:

Cipher cip = Cipher.getInstance("DES","Sun")

但是 Sun 提供程序的名称为“SunJCE”,IBM 的提供程序的名称为“IBMJCE”。 您也可以使用第三方提供商,例如 BouncyCastle。 您应该注意“ProviderNotFound”异常。

这将使用 Sun 实现:

Cipher cip = Cipher.getInstance("DES","SunJCE")

这将使用 IBM 实现:

Cipher cip = Cipher.getInstance("DES","IBMJCE")

如果您使用 IBM SDK,这将执行相同的操作:

Cipher cip = Cipher.getInstance("DES")

顺便说一句,如果您安装(编辑安全 SDK 文件)Sun 提供程序作为最后的提供程序,这不会以任何方式影响您的应用程序,因为当您查找算法时,JCE API 将查找第一个提供程序实例,然后查找第二个,依此类推(当它找到算法时,它会停止)。

To specify a security provider you should do that what you've said:

Cipher cip = Cipher.getInstance("DES","Sun")

But the Sun provider is named "SunJCE", the IBM's is "IBMJCE". You can use thir-party providers too as BouncyCastle. You should take care of the "ProviderNotFound" exception.

This will use the Sun implementation:

Cipher cip = Cipher.getInstance("DES","SunJCE")

This will use the IBM implementation:

Cipher cip = Cipher.getInstance("DES","IBMJCE")

If your are using the IBM SDK, this will do the same:

Cipher cip = Cipher.getInstance("DES")

By the way, if you install (editing the security SDK files) the Sun provider as the LAST provider, that shouldn't affect your application in any way because when you look for an algorithm, the JCE API will look for the first provider instances, then for the second, and so on (when it founds the algorithm, it stops).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文