×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    3

    Suggestion required regarding generation of Public-Private Key with SATSA

    Hi

    I am planning to implement RSA based encryption in J2ME.

    I could get information about SATSA which comes bundled with J2ME. I could get see that there are classes which actually allows you to encrypt with a public key.

    However, I could not locate the classes which would allow me to generate the public-private key pair (as I could not find classes available within SATSA or MIDP to do this)

    Can somebody please provide me a suggestion or any other alternative to generate the public-private key pair (based on RSA)?

    Regards
    Ahmad

  2. #2
    Regular Contributor
    Join Date
    May 2008
    Posts
    68

    Re: Suggestion required regarding generation of Public-Private Key with SATSA

    Hi,

    For encrypt/decrypt using public-private key you can use Bauncy Castle API

    By using SATSA using public key..

    byte[] publicKeyBits;
    // Assign publicKeyBits here.
    X509EncodedKeySpec pks = new X509EncodedKeySpec(publicKeyBits);
    KeyFactory kf = KeyFactory.getInstance("RSA");
    PublicKey publicKey = kf.generatePublic(pks);

    Signature signature = Signature.getInstance("SHA1withRSA");
    signature.initVerify(publicKey);
    signature.update(kData, 0, kData.length);

    boolean pass = signature.verify(kSignature);




    Thanks
    Ravi

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    3

    Re: Suggestion required regarding generation of Public-Private Key with SATSA

    Hello Ravi,

    Can you please let me know how to get the key i.e. value to be assigned to byte[] publicKeyBits;

    This is the public key i am referring to. This needs to be generated in a pair. (as both private and public key are needed). So, if you know a way to generate the pair then it would be helpful to me.

    Regards
    Ahmad

  4. #4
    Registered User
    Join Date
    Jul 2009
    Posts
    6

    Unhappy Re: Suggestion required regarding generation of Public-Private Key with SATSA

    Hi all,

    I'm working on j2me application for Asymmetric encrypting / decrypting sms for symbian OS..
    I've tried both BouncyCastle and Satsa for crypting but I'm facing to the same error wich is:

    ...
    Class org.netbeans.modules.classfile.StackMapFrame loaded from ant loader (parentFirst)
    at com.sun.midp.crypto.Util.cloneArray(), bci=1
    at java.security.spec.EncodedKeySpec.<init>(EncodedKeySpec.java:39)
    at java.security.spec.X509EncodedKeySpec.<init>(X509EncodedKeySpec.java:47)
    at hello.Rsa.encodeKey(Rsa.java:48)
    at hello.Rsa.startApp(Rsa.java:33)

    at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
    at com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
    at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
    at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
    at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
    at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
    at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
    java.lang.NullPointerException: 0

    I search for this error 10 days ago and Im really blocked...

    Many thx before,

    Simo

Similar Threads

  1. Series 60 J2ME emulator problems
    By evertomi in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2009-06-15, 10:21
  2. Socket problem: Only nokia's phones got errors
    By n0cturnal in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2008-01-11, 10:32
  3. illegal argument exception
    By jwidd in forum Mobile Java General
    Replies: 4
    Last Post: 2007-10-01, 20:43
  4. Help with lnk2019 lnk1120 error
    By yuenfatt in forum Symbian
    Replies: 8
    Last Post: 2007-08-24, 08:21
  5. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52

Posting Permissions

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