replace classes from sun.security.* packages

*爱你&永不变心* 提交于 2019-12-30 08:05:32

问题


I'm trying to upgrade an app from JDK7 to JDK8 which uses the following classes from the sun.security.* packages

sun.security.x509.X509CertImpl
sun.security.pkcs11.SunPKCS11
sun.security.util.DerOutputStream
sun.security.util.DerValue
sun.security.util.ObjectIdentifier
sun.security.pkcs.PKCS10
sun.security.x509.X500Name
sun.security.pkcs11.SunPKCS11
sun.security.pkcs11.wrapper.CK_TOKEN_INFO
sun.security.pkcs.PKCS10

The usage of these classes generates warnings in all cases except for sun.security.pkcs.PKCS10 which causes a compilation error, because this class no longer exists. It seems that it has moved to a different package sun.security.pkcs10.PKCS10.

While I could simply changes this package name and ignore the warnings generated by the other sun.security classes, I understand that you're not supposed to use classes in sun.security packages. How do I go about replacing these classes with their equivalent from the JDK8 public API?


回答1:


There aren't any equivalents in the JDK8 public API. You should switch to the BouncyCastle API instead.



来源:https://stackoverflow.com/questions/28603005/replace-classes-from-sun-security-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!