SHOW Signed
 

net.rim.device.api.crypto.certificate
Class SerialNumberIssuerKeyStoreIndex

java.lang.Object
  |
  +--net.rim.device.api.crypto.certificate.SerialNumberIssuerKeyStoreIndex
All Implemented Interfaces:
KeyStoreIndex

public class SerialNumberIssuerKeyStoreIndex
extends Object
implements KeyStoreIndex

Implements an index to allow you to look up a KeyStoreData object by the serial number and issuer of the certificate in the object.

The following example uses this index to search for a KeyStoreData object whose certificate has serial number serialNumber and issuer issuer:

KeyStore keyStore = DeviceKeyStore.getInstance();
keyStore.addIndex( new SerialNumberIssuerKeyStoreIndex() );

Object alias = SerialNumberIssuerKeyStoreIndex.getAlias( serialNumber, issuer );
Enumeration matchingKeys = keyStore.get( SerialNumberIssuerKeyStoreIndex.ID, alias );

For more information on using a keystore index, see Using the keystore index. This quick tutorial provides overview information as well as an example on how to use an index within a keystore.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0

Field Summary
 Category: Signed static long ID
          The id representing this index in the keystore.
 
Constructor Summary
 Category: Signed SerialNumberIssuerKeyStoreIndex()
          Creates a SerialNumberIssuerKeyStoreIndex object.
 
Method Summary
 Category: Signed  void addToIndex(KeyStoreData data, KeyStoreDataMap dataMap)
          Links the KeyStoreData object passed in with a hash of the serial number an issuer from the data object passed in.
 Category: Signed static Object getAlias(byte[] serialNumber, DistinguishedName issuer)
          This method takes a serial number and issuer, and returns an object that can be used as the alias in the KeyStore.get() method to find all certificates in the system with the given serial number and issuer.
 Category: Signed  int getHash(Object target)
          Returns a hash representing the target object passed in.
 Category: Signed  long getID()
          Returns a unique ID that represents this index within the key store.
 Category: Signed  boolean matches(KeyStoreData data, Object target)
          Determines if the target object ( a Alias containing a serial number and issuer ) matches the serial number and issuer contained within the data object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final long ID
The id representing this index in the keystore.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Constructor Detail

SerialNumberIssuerKeyStoreIndex

public SerialNumberIssuerKeyStoreIndex()
Creates a SerialNumberIssuerKeyStoreIndex object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

addToIndex

public void addToIndex(KeyStoreData data,
                       KeyStoreDataMap dataMap)
Links the KeyStoreData object passed in with a hash of the serial number an issuer from the data object passed in. The dataMap is used by the key store to find the appropriate records when doing searches based on this index.

Parameters:
data - The KeyStoreData object containing the serial number and issuer.
dataMap - The data map where the link is added.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getAlias

public static Object getAlias(byte[] serialNumber,
                              DistinguishedName issuer)
This method takes a serial number and issuer, and returns an object that can be used as the alias in the KeyStore.get() method to find all certificates in the system with the given serial number and issuer.

Parameters:
serialNumber - The serial number of the certificate. Should be non null.
issuer - The issuer of the certificate. Must be non null.
Returns:
An object that can be used in the KeyStore.get() method.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getHash

public int getHash(Object target)
Returns a hash representing the target object passed in.

Parameters:
target - The object to generate the hash on. Must be a Alias.
Returns:
An integer representing the hash of the target object passed into this method.
Throws:
IllegalArgumentException - if the specified target parameter is not a Alias.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getID

public long getID()
Returns a unique ID that represents this index within the key store.
Since:
JDE 3.6.0

Following copied from interface: KeyStoreIndex
Returns:
A long that is associated with the index.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

matches

public boolean matches(KeyStoreData data,
                       Object target)
Determines if the target object ( a Alias containing a serial number and issuer ) matches the serial number and issuer contained within the data object.

Parameters:
data - The key store data to compare against the target.
target - An Alias containing the serial number and issuer to compare against the data.
Returns:
true if the key store data object contains the same serial number and issuer as the target and false otherwise
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.