• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using certificate in mobile app

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know if it's possible to extract the public and private keys from a pkcs#12 file, and how could I do that.

Any help would be appreciated.

Thanks in advance.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kind greetings
I would start by looking up information on the Java Cryptography Extension API and the Java Cryptography Architecture. Of interest may be java.security.KeyStore
with methods getKey() and getCertificate().

Cheers.
 
raul marzo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response, but I'm working with J2ME and Bouncy Castle cripto libs, and I'm afraid that the KeyStore class is not available.

I'll reformulate my question: How can I read and use a .cer file (in X509 format) in a mobile application, so that I could extract its public key in order to extract its module and exponent, and generate a private key to sign some data?

Any help would be appreciated, cause I'm really stuck with this thing.
 
Set Cruz
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raul
I have just started to learn j2me. I have worked with Bouncy Castle as a provider in j2se. Using BC in j2se is a configuration change in the jvm, but the API remains the same. Is this not the case for j2me?

Additionally, did I understand correctly that you want to derive a private key from a public key?
 
raul marzo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your quick response, Set.

First, I think the BC API for J2ME is just a subset of its J2SE API. For example, the KeyStore or CertificateFactory classes are not present in j2me.

Also, you understood right the whole thing about deriving a private key from a public key, but I think it doesn't make sense, does it?
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot derive a private key from a public key.
reply
    Bookmark Topic Watch Topic
  • New Topic