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


Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card picture

Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card

$699.99



DAQ USB 8-channel, 16-bit, 250kHz, 2AO simultaneous sampling analog I/O module picture

DAQ USB 8-channel, 16-bit, 250kHz, 2AO simultaneous sampling analog I/O module

$340.00



Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog picture

Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog

$650.00



USED DELTA COMPUTER R100-H ANALOG MODULE RMC-ANLG R100H picture

USED DELTA COMPUTER R100-H ANALOG MODULE RMC-ANLG R100H

$950.00



NEW NO BOX- Analog Devices AIM03 Computer Module || Fast Shipped🇺🇸Warranty picture

NEW NO BOX- Analog Devices AIM03 Computer Module || Fast Shipped🇺🇸Warranty

$150.00



Columbus Instruments BP-2 Veterinary Automatic Blood Pressure Monitor picture

Columbus Instruments BP-2 Veterinary Automatic Blood Pressure Monitor

$175.95







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