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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Contributor
Posts: 3
Registered: ‎10-06-2010
My Device: Not Specified

Installing a self-signed CA certificate programmatically


i wanted to install a self-signed certificate (which acts as our CA) programmaticaly.

To do that i used the following code :


KeyStore deviceKeyStore= DeviceKeyStore.getInstance();

String subjectFriendlyName = certificate.getSubjectFriendlyName();

CertificateStatus certificateStatus=certificate.getStatus();

deviceKeyStore.set(null,subjectFriendlyName ,certificate,certificateStatus , deviceKeyStore.getTicket()); 


It works fine with the simulator (BB 9000). 

The thing is that when the set is called on the deviceKeyStore a password is asked.

I read that it is not possible to get rid of this password. But at least my self-signed certificate is installed in the keystore. If i go to Security Options > Certificate : i can see it in the list.


Now when i tried with a real phone (my application is signed). 

1) The CA (self-signed) certificate is never installed.

2) When my application connects to a server with a certificate signed with the CA certificate, it asks if i should trust it. I select trust but afterwards i get a warning window saying that my IT policy does not have sufficient privileges (or something like that). I have to manually trust the certificate going through the Security Options > Certificates and then click on the certificate and trust it.


Is it possible to install a self-signed certificate programmatically in the device keystore ? Have you been able to do this ? How can i get rid of the IT policy issue ?


Oh BTW, I am new to BB development Smiley Happy


Thanks in advance,


New Developer
Posts: 8
Registered: ‎02-11-2010
My Device: All versions
My Carrier: None

Re: Installing a self-signed CA certificate programmatically

Any updated here? Did you find a way to install the certificate?