• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

How to know KeyManager given a keystore

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a keystore file which be the keystore of the server.

I am trying to test ssl connectivity to that server with the program as given on http://www.herongyang.com/JDK/SSL-Socket-Server-Example-SslReverseEchoer.html

But I am getting a NoSuchAlgorithmException on the following line :

KeyManagerFactory.getInstance("SunX509");

// Can someone please tell me what all possible values I can pass to the above method, and what can be the best possible value by looking at the output below.

When I print the details of the certificate :

D:\Yogesh>keytool -list -keystore abc.jks -v -storepass xyz

Keystore type: jks
Keystore provider: SUN

Your keystore contains 2 entries:

Alias name: trustself
Creation date: Thu Sep 29 15:26:00 IST 2011
Entry type: keyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=#0C0C6864666362616E6B2E636F6D, OU=#0C10464F522054455354494E47204F4E4C5
9, O=#0C0E4D794F7267616E697A6174696F6E, L=#0C064D79546F776E, ST=#0C074D795374617
465, C=US
Issuer: CN=#0C0C6864666362616E6B2E636F6D, OU=#0C10464F522054455354494E47204F4E4C
59, O=#0C0E4D794F7267616E697A6174696F6E, L=#0C064D79546F776E, ST=#0C074D79537461
7465, C=US
Serial number: 23aa917a5e6203553b9784300ad8680
Valid from: Wed Sep 28 15:21:29 IST 2011 until: Mon Sep 29 15:21:29 IST 2031
Certificate fingerprints:
MD5: EC:9B:13:F6:E5:76:34:C8:F0:E6:B6:77:94:72:D7:FB
SHA1: 1F:A0:82:D5:B 4:FC:DA:01:36:71:B3:B 4:E8:F8:19:68:6D:B0:2D:04


*******************************************
*******************************************


Alias name: primatwo
Creation date: Mon Jan 16 17:46:14 IST 2012
Entry type: trustedCertEntry

Owner: CN=primauatapp.hbctxdom.com
Issuer: CN=primauatapp.hbctxdom.com
Serial number: 9ff84addac647a824198d4299a66fba3
Valid from: Mon Jan 16 12:36:34 IST 2012 until: Thu Jan 13 12:36:34 IST 2022
Certificate fingerprints:
MD5: 81:A9:3B:E5:DD:52:5E:2C:DD:42:91:20:E0:E6:C0:E0
SHA1: 42:0C:D5:6A:45:74:5D:7A:9D:CB:0D:F1:11:BB:7C:BC:38:F3:11:C0


*******************************************
*******************************************


 
Yogesh Gandhi
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I looked at java.security file

the key manager was found to be IbmX509

and when I used this value, I was able to run the program.
 
Yogesh Gandhi
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also use the following

KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());

The java.security file lies in C:\Program Files\Java\jdk1.6.0_21\jre\lib\security or which ever java you are using.

#
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
#
ssl.KeyManagerFactory.algorithm=SunX509
ssl.TrustManagerFactory.algorithm=PKIX

#
 
I was born with webbed fish toes. This tiny ad is my only friend:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic