For Programmers: Free Programming Magazines  


Home > Archive > Java Security > December 2004 > Getting rsa key and x509 cert into keystore









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Getting rsa key and x509 cert into keystore
Paul

2004-09-23, 3:59 pm

I would like to create an RSA key pair and an X509 cert and store both
of them in a JCA/JCE Key Store in Java2 SDK 1_4_2. I intend to use
them in another program to sign and encrypt xml documents.

I have figured out how to generate the RSA key pair using the
java.security package but I can't see any way to use it to create the
X509 cert.

Optionally, I can create the key pair and cert using openssl. Then I
can see how to import the cert from a file but not how to import the
RSA key pair from a file.

Sort of a catch22 here. I must be missing something very basic. Can
someone give me some guidance or point me to the correct place in any
documentation.

Thanks,
Paul
Rogan Dawes

2004-10-04, 9:09 am

Paul wrote:

> I would like to create an RSA key pair and an X509 cert and store both
> of them in a JCA/JCE Key Store in Java2 SDK 1_4_2. I intend to use
> them in another program to sign and encrypt xml documents.
>
> I have figured out how to generate the RSA key pair using the
> java.security package but I can't see any way to use it to create the
> X509 cert.
>
> Optionally, I can create the key pair and cert using openssl. Then I
> can see how to import the cert from a file but not how to import the
> RSA key pair from a file.
>
> Sort of a catch22 here. I must be missing something very basic. Can
> someone give me some guidance or point me to the correct place in any
> documentation.
>
> Thanks,
> Paul


Use the KeyTool that comes as part of the Java SDK (possibly also the
JRE) to create your X.509 cert

Rogan
--
Rogan Dawes

*ALL* messages to discard@dawes.za.net will be dropped, and added
to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"
Sebastian Hentschel

2004-12-15, 4:00 pm

I am using JDKPKCS12KeyStore from bouncy Castle
and for me it works fine

http://www.bouncycastle.org/docs/docs1.4/index.html

KeyStore ks = KeyStore.getInstance("PKCS12");
should create it.

Hope it helps

Paul wrote:
> I would like to create an RSA key pair and an X509 cert and store both
> of them in a JCA/JCE Key Store in Java2 SDK 1_4_2. I intend to use
> them in another program to sign and encrypt xml documents.
>
> I have figured out how to generate the RSA key pair using the
> java.security package but I can't see any way to use it to create the
> X509 cert.
>
> Optionally, I can create the key pair and cert using openssl. Then I
> can see how to import the cert from a file but not how to import the
> RSA key pair from a file.
>
> Sort of a catch22 here. I must be missing something very basic. Can
> someone give me some guidance or point me to the correct place in any
> documentation.
>
> Thanks,
> Paul

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com