DISQUS

Dobesland: Getting an SSL private key into glassfish | Dobesland

  • Neil Davis · 1 year ago
    Well, if you have a pkcs12 file (containing the public/private keypair), then with Java 1.6 its simple

    keytool -importkeystore -destkeystore MyKeyStore -srckeystore s1as.pkcs12 -srcstoretype PKCS12
    keytool -list -v -alias s1as -keystore MyKeyStore
    Enter keystore password:
    Alias name: s1as
    Creation date: Oct 22, 2008
    Entry type: PrivateKeyEntry
    Certificate chain length: 1
    Certificate[1]:
    Owner: CN=localhost, OU=Sun Java System Application Server, O=Sun Microsystems, L=Santa Clara, ST=California, C=US
    Issuer: CN=localhost, OU=Sun Java System Application Server, O=Sun Microsystems, L=Santa Clara, ST=California, C=US
    Serial number: 8b01b8a8
    Valid from: Mon Sep 29 20:21:15 BST 2008 until: Sat Sep 29 20:21:15 BST 2018
    Certificate fingerprints:
    MD5: 49:FC:9F:F2:99:7F:DE:DB:08:D4:44:4D:F7:64:DA:D2
    SHA1: AF:78:40:E1:56:37:37:53:E7:1E:3D:98:AD:5D:4B:60:6C:19:EE:CE
    Signature algorithm name: MD5withRSA
    Version: 3

    So, yes you can import a private key into a java keystore.....
  • dobes_vandermeer · 1 year ago
    Is that a new feature of 1.6? I suppose using openssl I can convert a
    any key file into pkcs12, so that's good news. Thanks!
  • Neil Davis · 1 year ago
    Yes, it's new in java 1.6. Cool eh?
  • dobes_vandermeer · 1 year ago
    Yes, very nice.