Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

replace classes from sun.security.* packages

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?

like image 512
TheDrag Avatar asked Feb 19 '15 09:02

TheDrag


1 Answers

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

like image 62
neu242 Avatar answered Oct 18 '22 02:10

neu242