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

Java Development

Reply
New Developer
Posts: 12
Registered: ‎09-03-2008
My Device: Not Specified

Signer ID - BlackBerry Signing Authority Tool

Where do I find the Signer ID that I was assigned after I applied for the 3 API keys (RRT, RCR and RBB).

 

I'm trying to setup a public/private key pair so that I can restrict access to PersistentObject store.

 

The field in the Signing Authority tool only allows for 4 characters and at first, I thought it was the long number that RIM provided as the client ID.

 

 

Developer
Developer
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

The signing authority tool is completely independent from the signer IDs assigned by RIM.   Basically you create you own signer IDs with it.  

 

During the setup, you create the signer id, "ACME" in the examples,  and a key pair.  You then issue YOURSELF a csi file to use with the Signature Tool.  

New Developer
Posts: 12
Registered: ‎09-03-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

gtj, thanks for the fast response.

 

Thanks for pointing out the Signer ID is self assigned.  That was a source of confusion for me.

 

However, when I use the code:

 

CodeSignKey codeSigningKey = CodeSigningKey.get( "ACME" );

 

I don't get a key back, I just get a null key.

 

 

So this is what I did to sign my app:

 

I created a public/private key pair using the Signing Authority Tool.

 

I added the *.key file to my project.

 

I double clicked on my application cod file.  It lists the key I created as required for the app to run (along with the RIM ones).

 

I use the File Signer tool from the Signing Authority Tool to sign the cod file with the app key (ACME).

 

I sign the cod file with the RIM keys.

 

In the Signature tool, the code file is signed with both the RIM keys and the one I created.

 

 

I run the program, and in debug I notice the codesigning key is null.

 

 

 

New Developer
Posts: 12
Registered: ‎09-03-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

Just to let you know, I am using:

 

JDE 4.3.0

4.3.0.124 8830 Simulator

Signing Authority Tool v1.0

 

No other simulators or JDEs installed

Developer
Developer
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

When you do CodeSigningKey.get("ACME") your actually trying to get the the key used to sign the String object that just happens to have a value of "ACME". 

 

To get the key used to sign the app do a CodeSigningKey.get(moduleHandle, "ACME");

 

You can also use CodeSigningKey.get(this);  IF "this" is a class signed with the key.   Be careful here though, you can't use this in an anonymous class because the anonymous class wasn't signed.

 

I.E:

UiApplication.getUiApplication().invokeLater(new Runnable() {

public void run() {

CodeSigningKey.get(this);

}

});

 

 isn't going to work.

 

 

 

 

New Developer
Posts: 12
Registered: ‎09-03-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

Great catch gtj.  I didn't understand what the docs were referring to and you anticipated my error in understanding.  Another way to put things, I have no clue what I'm doing. Smiley Happy

 

Ok, so let me recap and ask a few follow up questions:

 

To get the code to work, what I did was:

 

1 Add the key to the project

2 Right click on the key and assign it to all public and non-public classes (the exact choices are up to the developer)

3 Use the code:

 

CodeSigningKey.get(this);

 

This seems to work and I'll do some final testing later tonight.

 

Now I have a few more questions:

 

1 What does assigning the key to the package do (ie com.test.acme )?  

 

2 Why does the build fail with the following error when I assign the key to a specific class in my package?

 

Error!: Key file not found in key file index: 'com\test\ACME.key'

 

3 What's the moduleHandle integer?  Is this something tied to a resource or am I totally in the wrong ball park again?

 

 

Developer
Developer
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Signer ID - BlackBerry Signing Authority Tool

I don't use the JDE so I can't be sure why you get the problem with the missing file.

 

Setting the key to the package, associates the key to all classes in the package (but not to classes in subpackages).

 

 The module handle you can get by calling ApplicationDescriptor.currentApplicationDescriptor().getModuleHandle();