Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.security > #125 > unrolled thread

Accessing default .keysto

Started by"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
First post2011-04-27 16:08 +0000
Last post2011-04-27 16:08 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.lang.java.security


Contents

  Accessing default .keysto "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
    Re: Accessing default .ke "Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
      Re: Accessing default .ke "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
        Re: Accessing default .ke "Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000

#125 — Accessing default .keysto

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 16:08 +0000
SubjectAccessing default .keysto
Message-ID<a6a57413pb2u58mflvcce86amc3kv6tdd6@4ax.com>
  To: comp.lang.java.security
I currently have some code like this:

  /**
     * where to find .keystore
     */
    private static final String KEYSTORE_FILENAME =
"C:/users/roedy/.keystore";


...

    final KeyStore keystore = KeyStore.getInstance( "JKS" );
        keystore.load( new FileInputStream( KEYSTORE_FILENAME ), null
);
        return ( PrivateKey ) keystore.getKey(
RECEIVERS_PRIVATE_CERTIFICATE_ALIAS, PASSWORD );


Is there a way to just get the default .keystore without having to
guess where it is on disk?
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#127 — Re: Accessing default .ke

From"Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this>
Date2011-04-27 16:08 +0000
SubjectRe: Accessing default .ke
Message-ID<R5idnQOoyObGr-7VnZ2dnUVZ8h2dnZ2d@novis.pt>
In reply to#125
  To: comp.lang.java.security
Roedy Green wrote:

> I currently have some code like this:
> 
>   /**
>      * where to find .keystore
>      */
>     private static final String KEYSTORE_FILENAME =
> "C:/users/roedy/.keystore";
> 
> 
> ....
> 
>     final KeyStore keystore = KeyStore.getInstance( "JKS" );
>         keystore.load( new FileInputStream( KEYSTORE_FILENAME ), null
> );
>         return ( PrivateKey ) keystore.getKey(
> RECEIVERS_PRIVATE_CERTIFICATE_ALIAS, PASSWORD );
> 
> 
> Is there a way to just get the default .keystore without having to
> guess where it is on disk?
> 

[1] says about user-level certificates:

>The default locations of the of the keystore files for Unix and Windows are as follows:
>
>Operating System        Location
>Unix                    ${user.home}/.java/deployment/security. 
>Windows                 ${deployment.user.home}\security

So you can access those through the system properties.

There's the location of system-wide certs just below in that document. I
hope this applies - the user.home would be one of the place to search,
definately, though.

[1]
<http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/jcp.html>
-- 
Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#128 — Re: Accessing default .ke

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 16:08 +0000
SubjectRe: Accessing default .ke
Message-ID<ft2774hg4vsamr6okso2pkeoq4hfuee242@4ax.com>
In reply to#127
  To: comp.lang.java.security
On Tue, 08 Jul 2008 10:24:42 +0100, Sabine Dinis Blochberger
<no.spam@here.invalid> wrote, quoted or indirectly quoted someone who
said :

>>Unix                    ${user.home}/.java/deployment/security. 
>>Windows                 ${deployment.user.home}\security

I wonder what they mean by that?  There is no deployment.user.home
property.

On Jet there is:
user.home = C:\Users\roedy\AppData\Roaming\Microsoft\Windows

on Java.exe there is
user.home = C:\Users\roedy

user.dir seems to point to the cwd.

they say to look in C:\Docments and Settings\jsmith\Application
Data\Sun\Java\Deployment\security
for XP.

They also point out that Java does not create .keystore. The sysadmin
might put it anywhere, and might disguise it with any name.

possible directories on Vista include:
C:\Program Files\Java\jre1.6.0_06\lib\security
C:\Users\roedy\AppData\LocalLow\Sun\Java\Deployment\security
C:\Users\roedy\AppData\Roaming\Sun\Java\Deployment\security

I have summarised what I have discovered at
http://mindprod.com/jgloss/keystore.html
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#129 — Re: Accessing default .ke

From"Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this>
Date2011-04-27 16:08 +0000
SubjectRe: Accessing default .ke
Message-ID<Q-adnc_eOeag4enVnZ2dnUVZ8uudnZ2d@novis.pt>
In reply to#128
  To: comp.lang.java.security
Roedy Green wrote:

> On Tue, 08 Jul 2008 10:24:42 +0100, Sabine Dinis Blochberger
> <no.spam@here.invalid> wrote, quoted or indirectly quoted someone who
> said :
> 
> >>Unix                    ${user.home}/.java/deployment/security. 
> >>Windows                 ${deployment.user.home}\security
> 
> I wonder what they mean by that?  There is no deployment.user.home
> property.
> 
Yes, that's why I wondered if this applied at all (user.home does I
think) - the document I found is about deploying...

> On Jet there is:
> user.home = C:\Users\roedy\AppData\Roaming\Microsoft\Windows
> 
> on Java.exe there is
> user.home = C:\Users\roedy
> 
> user.dir seems to point to the cwd.
> 
> they say to look in C:\Docments and Settings\jsmith\Application
> Data\Sun\Java\Deployment\security
> for XP.
> 
> They also point out that Java does not create .keystore. The sysadmin
> might put it anywhere, and might disguise it with any name.
> 
Yes. IIRC, installing the JRE or JDK does not create any keystore. I
suppose you will always need to ask the user about it...

> possible directories on Vista include:
> C:\Program Files\Java\jre1.6.0_06\lib\security
> C:\Users\roedy\AppData\LocalLow\Sun\Java\Deployment\security
> C:\Users\roedy\AppData\Roaming\Sun\Java\Deployment\security
> 
> I have summarised what I have discovered at
> http://mindprod.com/jgloss/keystore.html
> 
Great! :)

-- 
Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.security


csiph-web