OpenCard  
 
OCF, the OpenCard Framework is a standard Java framework for working with Smart Cards.  
 

com.ibm.opencard.access
Class MFCCredentialStore

java.lang.Object
  |
  +--opencard.opt.security.CredentialStore
        |
        +--com.ibm.opencard.access.MFCCredentialStore

public class MFCCredentialStore
extends CredentialStore

A credential store for MFC smartcards. A credential is a combination of a cryptographic key and the algorithm it is intended for, for example DES. In the following explanation, replace key by credential to understand what is meant.
Key stores are used to hold an application's credentials, in form of cryptographic keys, for a specific smartcard. The same application may support different kinds of smartcards, which may require different keys for different cryptographic algorithms. For every smartcard supported, the application will initialize a card-specific key store appropriately, and present them to the card service in a key bag. The service will then pick the appropriate key store for the actual smartcard.
MFC smartcards support different, nested key domains. Within a domain, a key is identified by a unique number. The MFC key store is intended to hold the keys for exactly one key domain. It therefore provides methods to store and retrieve keys using integer numbers as key identifier. If an application needs to define keys for different key domains, for example a global domain and an application domain, there has to be one key store for each domain.

Version:
$Id: MFCCredentialStore.java,v 1.1 1999/12/02 16:06:01 damke Exp $
See Also:
CredentialStore, CredentialBag, SecureService.provideCredentials(opencard.opt.security.SecurityDomain, opencard.opt.security.CredentialBag)

Constructor Summary
MFCCredentialStore()
          Instantiates a new, empty credential store for MFC smartcards.
 
Method Summary
 java.util.Enumeration enumerateIDs()
          Gets the identifiers of all credentials stored.
 SignCredential retrieveCredential(int num)
          Retrieve a credential from this store.
 SignCredential retrieveCredential(java.lang.Integer id)
          Retrieve a credential from this store, with Integer identifier.
 void storeCredential(int num, SignCredential cred)
          Store a new credential in this store.
 boolean supports(CardID cardID)
          Checks whether these credentials are suitable for a particular smartcard.
 
Methods inherited from class opencard.opt.security.CredentialStore
fetchCredential, getCredentialIDs, getInstance, storeCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFCCredentialStore

public MFCCredentialStore()
Instantiates a new, empty credential store for MFC smartcards.
Method Detail

enumerateIDs

public final java.util.Enumeration enumerateIDs()
Gets the identifiers of all credentials stored. This method can be used if the credentials have to be organized in a different data structure.
Returns:
an Enumeration of all identifiers in this store
See Also:
Enumeration

supports

public final boolean supports(CardID cardID)
Checks whether these credentials are suitable for a particular smartcard.
Parameters:
cardID - ATR of the smartcard
Returns:
true if this store is suitable for the smartcard, false if the smartcard is not recognized
Overrides:
supports in class CredentialStore

storeCredential

public final void storeCredential(int num,
                                  SignCredential cred)
Store a new credential in this store. If the store already holds a credential with the given identifier, the new credential replaces the old one.
Parameters:
num - the identifier of the credential in it's domain
cred - the credential to add

retrieveCredential

public final SignCredential retrieveCredential(int num)
Retrieve a credential from this store. If several credentials with the same number have to be looked up, or if the number is already available as an Integer, the method retrieveCredential(Integer) should be used instead.
Parameters:
num - the identifier of the credential in it's domain
Returns:
the credential with the given identifier, or null if not found
See Also:
retrieveCredential(java.lang.Integer)

retrieveCredential

public final SignCredential retrieveCredential(java.lang.Integer id)
Retrieve a credential from this store, with Integer identifier. This method expects the identifier as an object rather than as an elementary data item. If several stores may have to be searched for a particular credential, this avoids the overhead of creating a new object for every lookup operation. It is also useful if the credentials are retrieved using the identifiers obtained from enumerateIDs.
Parameters:
id - the identifier of the credential in it's domain
Returns:
the credential with the given identifier, or null if not found
See Also:
retrieveCredential(int), enumerateIDs()