×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    54

    Authorisation failed error while installing jar

    Hi,

    i am currently working on a J2ME midlet which encrypts data using bouncycastle and then sends the data via httpConnection.

    All is working fine in the WTK 2.1 emulation however when i am trying to deploy the jar and jad files on NOKIA 6681, i am receiving the following error:

    Authorisation failed.

    I would be grateful if any help can be provided.

    Thanks

  2. #2
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Authorisation failed error while installing jar

    Hi,
    please whether your phone supports http connection from the device specifications.
    you can check it here

    http://www.forum.nokia.com/main/0,,0...tml?model=6681

    Thanks
    Soku

  3. #3
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: Authorisation failed error while installing jar

    Hi,

    have u signed the application?? if so please check whether u have given the correct jad permissions??
    please also check whether the jad & manifest entries are correct and they match each other correctly.

    Please also check whether u r using any apis not supported by 6681


    wang

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Authorisation failed error while installing jar

    Signing related information: http://www.forum.nokia.com/info/sw.n..._1_en.pdf.html (Tutorial on Signed midlets)

    Hartti

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Authorisation failed error while installing jar

    Hi Divyas,

    What kind of certificate are you using to sign your midlet?

    Daniel

  6. #6
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Authorisation failed error while installing jar

    The authorisation Failed message might be due to several reasons.

    1) May be due to that the MIDlet is using APi's that are not supported by the phone.

    2) Also might be due to some problem while Signing. It is not necessary that the app needs to be signed. But Signing will makes the app trusted and remove the permission messages.

    Hope this links are of some interest!.
    http://discussion.forum.nokia.com/fo...ization+failed

    Regarding Signing please check this link.
    http://discussion.forum.nokia.com/fo...hlight=signing

    Also there have been several discussions in this regard; please check the Forum.

    Regards
    Gopal

  7. #7
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    54

    Re: Authorisation failed error while installing jar

    Hi,
    I have not used any certificates... neither do i have set any permissions....

    My handset also supports the HTTPConnection.
    I have already installed and tested other applications made by me which used httpconnection... so i don think thts a problem.....

  8. #8
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Authorisation failed error while installing jar

    Hi,
    Check ou the APIs that you are using.May be anyone of those may not be supported by your phone..

    Thanks
    Soku

  9. #9
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Authorisation failed error while installing jar

    To make any type of network connection, a MIDlet must have an appropriate permission. For example, a MIDlet that uses HTTP to talk to a server must have permission to open an HTTP connection

    MIDlet-Permissions: javax.microedition.io.Connector.http

    Are you using this permission in JAD and MF?

    Regards
    Gopal

  10. #10
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    54

    Re: Authorisation failed error while installing jar

    hi Soku...
    I have not used any extra api other than Bouncy castle...n it is supportd on the handset.....

    Gopal....
    M not using this permission anywhere in the application... i din use it before also ... n it worked fine before.....

  11. #11
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Authorisation failed error while installing jar

    If you are using HTTP connection in your app, try adding the permission "MIDlet-Permissions: javax.microedition.io.Connector.http" in JAD and MF and send in your results!.

    EDIT: Just read that "The Bouncy Castle J2ME download package contains the implementation of the BC lightweight API as well as two core Java classes not supported in J2ME/CLDC: java.math.BigInteger and java.security.SercureRandom."

    Ref:http://www.javaworld.com/javaworld/j...-wireless.html

    Regards
    Gopal
    Last edited by balagopalks; 2006-05-24 at 10:44.

  12. #12
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    54

    Re: Authorisation failed error while installing jar

    Hi....

    yup u r right .. it might be bcause of this reason.. beacause my code is using one of this class secureRandom which is not supported by J2ME.....
    but how can i replace tht file somethin g else...
    do u hv any wrk around to solve it.....

    My code for encryption is as below:

    import org.bouncycastle.crypto.*;
    import org.bouncycastle.crypto.engines.*;
    import org.bouncycastle.crypto.modes.*;
    import org.bouncycastle.crypto.params.*;
    import org.bouncycastle.crypto.paddings.*;

    // A simple example that uses the Bouncy Castle
    // lightweight cryptography API to perform DES
    // encryption of arbitrary data.

    public class Encryptor {

    private BufferedBlockCipher cipher;
    private KeyParameter key;

    public static Encryptor encryptor;
    //private CrytoText cryptoText;

    // Initialize the cryptographic engine.
    // The key array should be at least 8 bytes long.

    public Encryptor( byte[] key ){
    encryptor = this;
    // cipher = new PaddedBlockCipher(new CBCBlockCipher(new DESEngine() ) );
    cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new DESEngine() ) );
    this.key = new KeyParameter( key );
    }

    // Initialize the cryptographic engine.
    // The string should be at least 8 chars long.

    public Encryptor( String key ){

    this( key.getBytes() );
    encryptor = this;
    }

    // Private routine that does the gritty work.

    private byte[] callCipher( byte[] data )throws CryptoException {
    int size = cipher.getOutputSize( data.length );
    byte[] result = new byte[ size ];
    int olen = cipher.processBytes( data, 0,data.length, result, 0 );
    olen += cipher.doFinal( result, olen );

    if( olen < size ){
    byte[] tmp = new byte[ olen ];
    System.arraycopy(result, 0, tmp, 0, olen );
    result = tmp;
    }

    return result;
    }

    // Encrypt arbitrary byte array, returning the
    // encrypted data in a different byte array.

    public synchronized byte[] encrypt( byte[] data )throws CryptoException {
    if( data == null || data.length == 0 ){
    return new byte[0];
    }

    cipher.init( true, key );
    return callCipher( data );
    }

    // Encrypts a string.

    public byte[] encryptString( String data )throws CryptoException {
    if( data == null || data.length() == 0 ){
    return new byte[0];
    }

    return encrypt( data.getBytes() );
    }

    // Decrypts arbitrary data.

    public synchronized byte[] decrypt( byte[] data )throws CryptoException {
    if( data == null || data.length == 0 ){
    return new byte[0];
    }

    cipher.init( false, key );
    return callCipher( data );
    }

    // Decrypts a string that was previously encoded
    // using encryptString.

    public String decryptString( byte[] data )throws CryptoException {
    if( data == null || data.length == 0 ){
    return "";
    }

    return new String( decrypt( data ) );
    }

    public static Encryptor getObject(){
    return encryptor;
    }

    }

  13. #13
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Authorisation failed error while installing jar

    Are you Obfuscating the JAR file?
    May be these links are of some interest!
    http://saloon.javaranch.com/cgi-bin/...&f=41&t=001597

    Download the PDF in this link and have a look at "Appendix A. Bouncy Castle and Obfuscation"
    http://nds2.fds-forum.nokia.com/fdp/...124a04a&lid=FN

    Bouncy Castle Crypto package
    http://www.mobilefish.com/developer/...ncycastle.html

    Regards
    Gopal

  14. #14
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    54

    Re: Authorisation failed error while installing jar

    I have obfuscated the jar but still its not workin.. it is showing the same error "authorisation Failed"

    does that mean the BC Api does not work fr Mobile encryption coz it uses certain files which are not supported by J2ME......n thus not by handsets......
    Last edited by divyas; 2006-05-25 at 05:51.

  15. #15
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Bouncy Castle works in J2ME. Make sure to download their J2ME package which includes all classes required. Additionally, make sure to include all classes mentioned above. There are some classes in the java.* namespace which have to be included in your JAR. After obfuscating, these classes move out of the java.* namespace (automatically), otherwise your JAR would be rejected because class files in the java.* namespace are not allowed in MIDP.

    Read the documentation at Bouncy Castle and inspect the output before and after obfuscating. Before obfuscating, there should be one or two files within the java.* namespace. At the end in the final JAR, there should be the same (exact) amount of class files, however, no java.* folder anymore.

Similar Threads

  1. "Authorization failed" message displayed when installing jar file
    By capricious28 in forum Mobile Java General
    Replies: 10
    Last Post: 2014-07-04, 11:22
  2. Phone restarting after installing jar
    By ashishga in forum Mobile Java General
    Replies: 7
    Last Post: 2006-11-08, 05:39
  3. nokia 6630 and JABWT: authorisation failed (authorization failed)
    By activetools in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2006-06-30, 08:15
  4. Error when installing jar file using servlet.
    By jpori in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-06, 08:48
  5. J2ME Installing problems on 7650
    By rickyhaggett in forum Mobile Java General
    Replies: 6
    Last Post: 2003-04-29, 23:59

Posting Permissions

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