Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tarun Khandelwal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic