View Single Post
  #7 (permalink)  
Old 11-15-2005, 01:06 PM
manthrax3 manthrax3 is offline
Active Member
 
Posts: 42
Default

Here is a little java app that does it:

import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.Key;

public class DumpPrivateKey {
static public void main(String[] args) {
try {
KeyStore ks = KeyStore.getInstance("jks");
ks.load(new FileInputStream("tomcat.keystore"),
"changeit".toCharArray());
Key key = ks.getKey("tomcat",
"changeit".toCharArray());
System.out.write(key.getEncoded());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Reply With Quote