Meaningless Drivel is fun!*
The moose likes Security and the fly likes How to load Private Key Generated Using C code into java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to load Private Key Generated Using C code into java application" Watch "How to load Private Key Generated Using C code into java application" New topic
Author

How to load Private Key Generated Using C code into java application

Tarun Khandelwal
Greenhorn

Joined: Feb 23, 2012
Posts: 19
Hello Everyone,

In my application i am receiving RSA private key that is being generated using C code. in c RSA library is used.
Now i am not getting how to load that private key into RSAPrivateKey Object.
Please let me know how could i do that.
RSA Lib I am using consists of:-
DES.H
DIGIT.H
GLOBAL.H
MD2.H
MD5.h
NN.H
PRIME.H
R_RANDOM.H
RSA.H
RSAREF.H
DESC.C
DIGIT.C
MD2C.C
MD5C.C
NN.C
PRIME.C
R_DH.C
R_ENCODE.C
R_ENHANCE.C
R_KEYGEN.C
R_RANDOM.C
R_STDLIB.C
RSA.C

It would be great if i can get how to load private key from the one generated by c code.


Thanks,
Tarun Khandelwal
Tarun Khandelwal
Greenhorn

Joined: Feb 23, 2012
Posts: 19
Hello Everyone,

The process that c code is using to generate both keys is,

First it is using R_GeneratePEMKeys for getting Public and Private key Object.
Than it is using R_EcodePEMBlock function to encode both private and public key individually.
I am receiving this PEM Encoded private key.
Now i have to load RSAPrivatekey object using this key object.
How can i do that?

Thanks,
Tarun Khandelwal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to load Private Key Generated Using C code into java application