×

Discussion Board

Results 1 to 11 of 11

Thread: Store RSA keys

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    Unhappy Store RSA keys

    Hi,
    I´m working on SMS encryption.
    I´ve got S60 3rd edition SDK.
    I´m using RSA algorithm provided at Symbian Criptography Library. I can encrypt and decrypt but i can´t store de keys that i generate.
    First, i tried to write the KeyPair object to a file, redefining the ExternalizeL and InternalizeL methods, but these methods only work when you try to write pre-defined types (such as integer, booleans, descriptors...), and the types I want to store are CRSAPrivateKey and CRSAPublicKey.
    Then I found the The unified key store, but it won´t work with my SDK (only works with S60 UIQ).
    At least, i tried to write the parameters that create the keys, but It is impossible to obtain the D parameter from de Private Key.
    Any idea?
    Thank you so much.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Store RSA keys


  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    2

    Re: Store RSA keys

    Quote Originally Posted by wizard_hu_ View Post
    Yes, but using S60 3rdEdition, you can't include <x509keys.h>.
    Also, there are no explanations about how to work and store the private key.
    Someone knows where to find more useful information, or any example about how to store in memory the keys?
    Thanx

  4. #4
    Registered User
    Join Date
    Jul 2007
    Posts
    20

    Re: Store RSA keys

    Hi
    I have the same problem. Have any resolve this problem.
    How to export public key and private key in S60 3rd MR.
    Thanks in advance.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Store RSA keys

    TInteger and RInteger seem to be the relevant classes, and there are TInteger::BufferLC and RInteger::NewL apparently suitable for storing-restoring.

  6. #6
    Registered User
    Join Date
    Jul 2007
    Posts
    20

    Re: Store RSA keys

    TInteger and RInteger seem to be the relevant classes, and there are TInteger::BufferLC and RInteger::NewL apparently suitable for storing-restoring.
    I know that, but how to get the D parameter from the private Key.
    This is my problem.

    Maybe there is diffrent way to export private and public key. Any suggestion?
    Last edited by rbox; 2008-10-24 at 14:32.

  7. #7
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Store RSA keys

    Unfortunatly the API's you require are not in the public SDK, you need to be a Symbian partner to use and obtain them.

    There is more information and examples on working with certificates here, and though its UIQ documentation it works with S60 as well.

    http://developer.uiq.com/devlib/uiq_....creatingStore
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    283

    Question Re: Store RSA keys

    RSA without sending keys or getting it become with no benfits and what the solution to interest from RSA in symbian.(i generate keys and encrypt and decrypt in the same machine and in the same time and after close program i can't decrypt encrypted message)
    Ahmed Mahfouz
    Researcher
    Handset

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Store RSA keys

    Note that the restriction is about the private key, which is not required for encryption. The use case is that you generate the keys, send the public key to anyone, then the message can be encrypted using the public key, but only you will be able to decrypt it.

  10. #10
    Registered User
    Join Date
    Jun 2008
    Posts
    283

    Re: Store RSA keys

    Quote Originally Posted by wizard_hu_ View Post
    Note that the restriction is about the private key, which is not required for encryption. The use case is that you generate the keys, send the public key to anyone, then the message can be encrypted using the public key, but only you will be able to decrypt it.
    yes but private required for decryption so i need to store and i will try the snippet code u give me in the another thread and if this correct and generation of keys with e,n are the same the problem solved
    Ahmed Mahfouz
    Researcher
    Handset

  11. #11
    Registered User
    Join Date
    Jan 2007
    Posts
    282

    Re: Store RSA keys

    May be I have understood your question incorrectly. But you can only get the D parameter of an rsa key pair if you have generated the key pair with EStandard flag CRSAKeyPair::NewL(2048,EStandard); . Default is EStandardCRT that uses chinese remainder theorm to speed up computations. D parameter if only valid for standard keys.

    If you have standard key then you can cast the PrivateKey() output to CRSAPrivateKeyStandard & to get the D parameter in way similar to code below:

    const RInteger & d= ((CRSAPrivateKeyStandard &)generator->PrivateKey()).D();

    Once you have the RInteger you can simply store it to a file or any place you need by simply using the RInteger::BufferLC() method.

    Hope that helps,
    VJ

Similar Threads

  1. Nokia N81 soft keys
    By ronanocie in forum Mobile Java General
    Replies: 7
    Last Post: 2009-03-30, 12:39
  2. N93 - using external display and keys
    By gotzinger in forum Symbian
    Replies: 4
    Last Post: 2008-05-07, 18:15
  3. Register application: record store alternate
    By tgkprog@gmail.com in forum Mobile Java General
    Replies: 1
    Last Post: 2007-09-07, 08:21
  4. Simple Stream in Store Problem
    By mitay2 in forum Symbian
    Replies: 1
    Last Post: 2004-12-08, 18:03
  5. Record Store vs JDBC. How to store data?
    By 180ºrevolution in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-17, 15:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •