BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-25-2010, 01:28 AM   #1
AnisimovSPB
New Member
 
Join Date: Jun 2010
Model: 8900
PIN: N/A
Carrier: Beeline
Posts: 1
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


*PARTS/REPAIR* Mitsubishi FR-A520-5.5K-NA A500vInverter In: 35.5A 3Ph Out: 10Hp picture

*PARTS/REPAIR* Mitsubishi FR-A520-5.5K-NA A500vInverter In: 35.5A 3Ph Out: 10Hp

$750.00



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220 picture

MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220

$684.00



1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter picture

1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter

$401.02



1PCS USED A500 7.5KW 380V FR-A540-7.5K-CH picture

1PCS USED A500 7.5KW 380V FR-A540-7.5K-CH

$347.76



1pc   used      A500 inverter FR-A540-3.7K 3.7KW380V picture

1pc used A500 inverter FR-A540-3.7K 3.7KW380V

$258.74







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