Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Running apps that use protected APIs

To use Research In Motion's protected BlackBerry APIs in your app, you must first get code signing keys from RIM. For more information about code signing and to register with RIM to use protected APIs, visit https://www.blackberry.com/SignedKeys/codesigning.html.

If a BlackBerry device application tries to access protected RIM APIs, the BlackBerry Java Plug-in for Eclipse might display warning messages in the Java editor window or in the Problems view. The warning messages appear next to the lines of application code that reference a protected API. You can suppress these warnings if you test your application on a non-secure device.

Register to use protected BlackBerry APIs

  1. Visit https://www.blackberry.com/SignedKeys/codesigning.html. and complete the registration form.
  2. Save the .csi files that Research In Motion sends to you. The .csi files contains a list of signatures and your registration information.

Install new keys

Once you receive the code signing emails from RIM, you must install the keys.

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand BlackBerry Java Plug-in.
  3. Click Signature Tool.
  4. Click Install New Keys.
  5. Navigate to the location of your signature (.csi) file, click the file, and click Open.
  6. Click OK.

Once you have installed the keys, you can delete the .csi files. They can't be used again.

Sign your application

  1. In Eclipse, in the Package Explorer view, right-click a BlackBerry application project.
  2. Click BlackBerry > Sign with Signature Tool.
  3. In the Signature Tool dialog box, click Request.
  4. Type your private key password.
  5. Click OK.

Prevent a BlackBerry device application that runs on the BlackBerry Smartphone Simulator from accessing protected APIs

To prevent an application that runs on the BlackBerry Smartphone Simulator from accessing protected APIs, you must turn on device security in the BlackBerry Smartphone Simulator.

  1. In Eclipse, on the Run menu, click Debug Configurations or Run Configurations.
  2. Expand the BlackBerry Simulator item.
  3. Select an existing launch configuration for a BlackBerry Smartphone Simulator, or create a new one.
  4. Click the Simulator tab.
  5. Click the General tab.
  6. Select Enable device security.
  7. Click Run.

Import an existing registered code signing key

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click Signature Tool.
  4. Click Import Existing Keys.
  5. Navigate to the location of the BlackBerry development environment that you want to import the key from.
  6. Select the folder that you want to import the key from.
  7. Click OK.

Remove a registered code signing key

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click Signature Tool.
  4. Click Remove Keys.
  5. Click Yes.
  6. Click OK.

View the signature status for code signature requests

For files that the BlackBerry Signing Authority Tool has signed, the status is Signed. For files that the BlackBerry Signing Authority Tool did not sign, the status is Failed. The BlackBerry Signing Authority Tool might have rejected the .cod file because the private key password was typed incorrectly.

  1. In Eclipse, on the Project menu, click BlackBerry > Sign with Signature Tool.
  2. Select a .cod file.
  3. View the Status column.

Sign a BlackBerry application project automatically after packaging

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click Signature Tool.
  4. Select Automatically sign the .cod files after packaging.
  5. Click OK.

Turn off automatic signature when you package a BlackBerry application project

By default, when you package a BlackBerry application project, the BlackBerry Signature Tool runs automatically to sign .cod files that access protected APIs.

To turn off this feature and run the BlackBerry Signature Tool manually, complete the following tasks:

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click the Signature Tool item.
  4. Clear the Automatically sign the .cod files after packaging option.
  5. Click OK.

Run the BlackBerry Signature Tool in the background

You can run the BlackBerry Signature Tool automatically after you package your BlackBerry application project by completing the following steps.

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click the Signature Tool.
  4. Select the Run Signature Tool in background check box.
  5. Click OK.

Suppress password prompts from the BlackBerry Signature Tool

When you package a BlackBerry application project, the BlackBerry Signature Tool prompts you for your signing password.

You can save your signing password for the Eclipse session.

  1. When you are prompted, in the Signing Password dialog box, select Remember password.
  2. Click OK.

Suppress code signing warnings

  1. In Eclipse, on the Window menu, click Preferences.
  2. Expand the BlackBerry Java Plug-in item.
  3. Click Warnings.
  4. Select the keys for the protected APIs that you do not want to see warnings for.
  5. Click OK.