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

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?