BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 06-25-2010, 01:28 AM   #1 (permalink)
New Member
 
Join Date: Jun 2010
Model: 8900
PIN: N/A
Carrier: Beeline
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default KeyStoreData.getPrivateKey(KeyStoreDataTicket)

Please Login to Remove!

Hi, all!

I got stuck on receiving a private key from the TrustedKeyStore. My code is:

Code:
KeyStore keyStore = TrustedKeyStore.getInstance();
Enumeration keyContainers = keyStore.elements();
while (keyContainers.hasMoreElements()) {
  KeyStoreData keyContainer = (KeyStoreData) keyContainers.nextElement();
  if ("MySPBCompany".equals(keyContainer.getLabel())) {
    Certificate certificate = keyContainer.getCertificate();
    PrivateKey privateKey = keyContainer.getPrivateKey(keyContainer.getTicket());
    if (privateKey != null) {
        // signing message using appropriate signer
    }
  }
}
The issue is I always get null value of the privateKey variable after calling "keyContainer.getPrivateKey(..)" method. It doesn't let me get private key from the KeyStore inspite of it has private key installed with the certificate (I can see a "Private Key on Device" label while viewing "MySPBCompany" certificate properties).

Does anybody know a way to get round this issue?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

SMC NVJ3133 Solenoid Valve 12 Port Manifold
$34.99
SMC NVJ3133 Solenoid Valve 12 Port Manifold  pictureAir Valve, 2 pos, 24VDC SMC Type VFS2120-5E-01-F Solenoid Valve 4/5 Port
$22.0
Air Valve, 2 pos, 24VDC SMC Type VFS2120-5E-01-F Solenoid Valve 4/5 Port pictureNEW Parker Versa Solenoid Valve ESM-2301-60-HC-A120 - 2-way - BNIB
$60.0
NEW Parker Versa Solenoid Valve ESM-2301-60-HC-A120 - 2-way - BNIB pictureMiller 199530 SOLENOID,IDLE
$150.0
Miller 199530 SOLENOID,IDLE pictureWinco 64854-005 Emergency Fuel Solenoid Shut-Off for Tri-Fuel Generators
$236.99
Winco 64854-005 Emergency Fuel Solenoid Shut-Off for Tri-Fuel Generators picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.