Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Regular Contributor
DHulka
Posts: 53
Registered: ‎06-25-2012
My Device: Z10
My Carrier: Rogers

Error Loading Certificate: Java.io.IOException

I'm following the instructions on this page to set up my environment:

https://developer.blackberry.com/android/documentation/install_plugin_prerequisites_1895476_11.html

I'm also using my saved signing keys but whenever I try to load an app on my device or  go into the Bar Signer option I get the following error:

"Error loading certificate: java.io.IOException: subject key, java.security.InvalidKeyException: Invalid EC key"

The software can't create a debug token either, seems to happen whenever the program tries to create a Debug Token, I've cleared the debug token off of my devices as well.

Please use plain text.
Developer
maribou
Posts: 40
Registered: ‎04-01-2009
My Device: Torch 9810
My Carrier: Rogers

Re: Error Loading Certificate: Java.io.IOException

I have the same problem with a certificate created by the same tool in January 2012.  I can create a new certificate without a problem, but get the "Invalid EC key" message with the old one.

Please use plain text.
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)
My Carrier: Vodafone

Re: Error Loading Certificate: Java.io.IOException

I have the same issue. When trying to deploy an Android app to PlayBook I get prompted to create a new debug token, when I click OK I get the following error: 

 

Error loading certificate: java.io.IOException: subject key,

java.security.InvalidKeyException: Invalid EC Key

 

Reason: 

Error loading certificate: java.io.IOException: subject key,

java.security.InvalidKeyException: Invalid EC Key


Anyone got a workaround?

Please use plain text.
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)
My Carrier: Vodafone

Re: Error Loading Certificate: Java.io.IOException

I found that if you use the Momentics IDE then it works fine, but I imagine for most Android developers they won't have this installed so I have a solution which involves creating a debug token from the command line. 

 

1. First find where your developer certificate and keys are located, this is usually: 

 

C:\Users\<username>\AppData\Local\Research In Motion

 

You should have the following files in there: 

 

author.p12

barsigner.csk

 

2. Open a command prompt and cd to your BlackBerry tools/bin directory. You can find this by right clicking on your project in Eclipse and going to BlackBerry Tools->Configure targets, then clicking on BlackBery Tools SDK. On my machine it is: 

 

C:\eclipse\plugins\net.rim.ajde_1.2.0.201207131336\blackberry.tools.SDK\bin

 

3. Run the following command: 

 

blackberry-debugtokenrequest -cskpass <CSKpassword> -keystore <Your P12 Developer Certificate> -storepass <Certificate Password> -deviceId <Your Blackberry Playbook Device ID in hex format (eg 0x29D91835)> <Output Debug BAR file name, example.bar>

 

This should create you a debug token

 

4. Now go back into eclipse BlackBerry Tools -> Configure targets. Click on Debug Token Details->Import, specify your newly created debug token. 

 

That's it, your debug token should be installed on the device. 

Please use plain text.
New Developer
Noureen
Posts: 8
Registered: ‎09-24-2012
My Device: BlackBerry Playbook Android
My Carrier: BlackBerry

Re: Error Loading Certificate: Java.io.IOException

Hi!
  I am trying to set the volume of BB Playbook in android through audio manager using SeekBar but the volume of device is not changing. however if i try to get the current volume of system (BB Palybook) it shows me the correct volume but when i try to set the volume through seekBar it did not works. here is my code :

 

import android.media.AudioManager;

this is the import for audioManager

 

AudioManager audioManager;

this is the audioManager variable

 

seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub

}

public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub

}

public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
// TODO Auto-generated method stub

audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0 );


}

 

});

 

Please if anyone have solution to this problem. what i think that this happens due to BB security restrictions. Is that so??

Please use plain text.
New Contributor
vcor
Posts: 8
Registered: ‎05-09-2012
My Device: Playbook
My Carrier: None

Re: Error Loading Certificate: Java.io.IOException

The instructions are not working for me on step 3 blackberry-debugtokenrequest. I really spent about a hour trying to make this work!

 

1. I get an Error: No devices specified

 

It's not clear where you get the Device ID. In the PlayBook About dialog the "BlackBerry ID" is my email address (not Hex). This generates an error.  Next I tried to use the Hardware Device PIN (8 hex digits). I’ve tried this 8 digit hex number both with and without “0x” prefix. I’ve also included the full path and filename author.p12 in quotes (since there are spaces in the directories.

 

How to you find the Hex device ID?  A Google search didn't turn up anything useful. If this is the Hardwrare Device PIN, any other ideas what may be going wrong?  I've reviewed the line very carefully for the correct spaces, etc.

 

2. Any hope this bug (java.io.IOException) will be fixed so you don't have to go through all this manual work? The Eclipse BlackBerry Deployment Setup Wizard used to do all this work for us, but it no longer works.

Please use plain text.
New Contributor
vcor
Posts: 8
Registered: ‎05-09-2012
My Device: Playbook
My Carrier: None

Re: Error Loading Certificate: Java.io.IOException

Ok, I solved this. A copy of the commands I first put in Word (to keep track of what I was doing) changed a dash to an em-dash! It was not at all obvious!

 

Also the Device ID is found in the PlayBook at Settings, About.  Switch the top option from "General" to "Hardware".  The first line "PIN" is the device id in hex.

 

If you're having problems, here's a clearer example of how it should look (with the passwords set to "myPassword"  and user name changed to "MyName", and deviceid set to 1234ABCD:

 

blackberry-debugtokenrequest -cskpass myPassword -keystore "C:\Users\MyName\AppData\Local\Research In Motion\author.p12" -storepass myPassword2 -deviceid 0x1234ABCD debugtok.bar

Please use plain text.
Super Contributor
lyon819
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: Error Loading Certificate: Java.io.IOException

my example

blackberry-debugtokenrequest -cskpass *******  -keystore "C:\bb10beta4\host_10_0_9_284\win32\x86\usr\bin\author.P12" -storepass ******* -deviceId **** debugtoken.bar

 

-Fight with BB10
Please use plain text.
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)
My Carrier: Vodafone

Re: Error Loading Certificate: Java.io.IOException

[ Edited ]

I've created a batch script to create my debug tokens. Thought I'd share it: 

 

set LOCAL_DATA_PATH="c:\Users\<your_username>\AppData\Local\Research In Motion"
set CSK_PASSWORD=your_csk_password
set CERT_STORE_PASSWORD=your_authorp12_password
set DEVICE_PIN=your_device_pin

blackberry-debugtokenrequest -cskpass %CSK_PASSWORD% -keystore %LOCAL_DATA_PATH%\author.p12 -storepass %CERT_STORE_PASSWORD% -devicepin %DEVICE_PIN% %LOCAL_DATA_PATH%\debugtoken.bar

Insert your own details and save this as create-debugtoken.bat in your BlackBerry tools folder, on my machine this is: 

 

c:\eclipse\plugins\net.rim.ajde_1.5.1.201301180815\blackberry.tools.SDK\bin

 

Now just run the batch file and your debugtoken will be created in your LOCAL_DATA_PATH folder.

 

Note you can easily get your Device PIN from within eclipse by doing Preferences->BlackBerry->BlackBerry Tools SDK->Bar Signer then under 'Debug tokens' click 'Create...' then 'Add' then 'Autodiscover'

 

Please use plain text.
New Contributor
jabanaki
Posts: 4
Registered: ‎10-21-2012
My Device: Playbook
My Carrier: n/a

Re: Error Loading Certificate: Java.io.IOException

I was getting the same Exception in Eclipse, but managed to resolve the problem by forcing Eclipse to run using Java 6 rather than Java 7. 

 

In my eclipse.ini I added the line

 

-vm
C:\Program Files\Java\jdk1.6.0_41\bin\javaw.exe

 

Please use plain text.