File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes Alternatives for* Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Alternatives for*" Watch "Alternatives for*" New topic

Alternatives for*

Sverre Moe
Ranch Hand

Joined: Jul 10, 2007
Posts: 110
Using Sun/Oracle JDK 1.6 I have access to and are using the following imports from the JDK.

As of Sun/Oracle JDK 1.7 these are no longer available. What can I use instead of these? Are there any alternatives in either JDK or some other API?

I am using these to generate a Certificate Signing Request (PKCS#10) in Java. I want to do this programmatic and not via a seperate running tool like OpenSSL or Java Keytool.
Tim Moores

Joined: Sep 21, 2011
Posts: 2408
One approach would be to use the BouncyCastle API:
Sverre Moe
Ranch Hand

Joined: Jul 10, 2007
Posts: 110
It seems like JDK7 haven't gotten rid of all the classes in BouncyCastle is still using some of its classes.
Just the X500Signer class is gone from JDK7.

The following code is working fine to create a Certificate Signing Request:

This I have tried to replace with the following BouncyCastle code:

But it gives the following complaint: no such provider: BC
I can specify a provider in PKCS10CertificationRequest, but I am unsure what this is supposed to be.

Edit: I found the solution to this: When passing null for provider it creates a Signature that same way as my first solution without provider.
I agree. Here's the link:
subject: Alternatives for*