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

Replace WebLogic Specific loadLocalIdentity Code

Joe Jeeka

Joined: Sep 20, 2013
Posts: 4

I've been tasked with taking a legacy app that runs on WebLogic 10 and making it run on Tomcat 7. I have done everything except one part now. I am having a little trouble because documentation is sparse and I am not sure what this code does in order to figure out what I need to do to convert it to Tomcat friendliness. The code in question is weblogic library code. The code has been around for a while unchanged and is kind of all over the place. I'll try to piece it together so it is readable...

//The following is basically pseudo code since it is working with Weblogic.
//And the code is all over the place and on an intranet I am trying to narrow down only what is needed for you to get the idea
//There is just one line of code that I need to figure out how to do w/o WL libs
KeyStore userKeyStore = KeyStore.getInstance("JKS");
X509Certificate cert = (X509Certificate) userKeyStore.getCertificate("keyname");
Certificate certAr[0] = cert;
PrivateKey pk = getPrivateKeyMethod();

//The next two lines (I hope) is all I need to replace for this to work in Tomcat ?!?!
weblogic.jndi.Environment wlEnv = new weblogic.jndi.Environment();
wlEnv.loadLocalIdentity(certAr, pk);

//More code to connect to service

Hopefully all I need to do is replace the weblogic specific code above with a Java standard or third party APIs. If not I will get a more full example of the code together if needed in the post.

1. Where is the local identity being loaded by the call to loadLocalIdentity(...) ? I mean, no where after the call do I see code that accesses anything from wlEnv where is the local identity going once sucked in by this method?

2. Any links to documentation on the loadLocalIdentity(Certificate[], PrivateKey) (other than "this loads the local identity" that about all I'm seeing out there.) ?

3. If there is code that will do what that is doing w/o WebLogic libs please let me know.

I agree. Here's the link:
subject: Replace WebLogic Specific loadLocalIdentity Code
It's not a secret anymore!