Using code signing keys to restrict access to packages or classes in a
BlackBerry library
project
You can help protect the
packages and the classes in your
BlackBerry® library project by using your own code signing key. For more information about the code signing process visit
www.blackberry.com/go/devguides to see the
BlackBerry Signing Authority Tool Version 1.0 - Password Based
Administrator Guide.
Note: You can help protect a package or a class with only one
private key at a time.
Before you begin: You must have a key
pair (public key and private key). You can get a key pair by using the
BlackBerry® Signing Authority Tool. To download the
BlackBerry Signing Authority Tool visit
www.blackberry.com/developers/downloads.
-
Complete one of the following tasks:
|
Task
|
Steps
|
|
Copy a public key (.key) into your
BlackBerry library project.
|
- In the
Package Explorer view, copy and
paste the private key into the
/src folder of your
BlackBerry library project.
- Double-click
the private key to open the key editor.
|
|
Import a public key (.key) into your
BlackBerry library prloject.
|
- On the
File menu, click
Import.
- Expand
General and click
File System.
- Click
Next.
- In the
From directory dialog box, click
Browse. Navigate to the location
of the private key and click OK.
- In the
right-hand pane, select the private key.
- In the
Into folder dialog box, click
Browse and navigate to the
location of the
/src folder of your
BlackBerry library project.
- Click the
src folder and click
OK.
- Click
Finish.
- Double-click
the private key to open the key editor.
|
|
Link a public key (.key) to your
BlackBerry library project.
|
- In the
Package Explorer view,
right-click the
/src folder of your
BlackBerry library project.
- Click
New > File.
- Click
Advanced.
- Select the
Link to file in the file system
option.
- Click
Browse to navigate to the
location of the private key and click
Open.
- Click
Finish.
The key editor opens automatically.
|
-
In the key editor, select the package or class that you want to
restrict access to.
-
Close the key editor and click
Save.
-
Package your
BlackBerry
library project.
Access to the .cod file that is created is restricted at
runtime.
After you finish:
When a
BlackBerry device
application accesses a package or a class that is protected in the
BlackBerry
library project, the application's .cod file must be signed with the same
private key as the package or class. You can sign the .cod file with the
private key by using the File Signer tool in the
BlackBerry Signing Authority Tool.
Was this information helpful? Send us your comments.