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

com.ibm.opencard.access
Class MFCCredentialSet

java.lang.Object
  |
  +--com.ibm.opencard.access.MFCCredentialSet

public class MFCCredentialSet
extends java.lang.Object

A credential collection for MFC smartcards. MFC smartcards identify a key that has to be used by a key domain, which is specified by a path, and a key number. A credential is a tuple of a key and the associated algorithm, which is DES, RSA or DSA for MFC smartcards. This credential collection allows storing and retrieving credentials using a path and an integer as arguments.
When retrieving a key, the path provided may be that of a subdirectory within the key domain. In order to find the key, a backtracking algorithm has to be used. This means, if the key is not found with the path given, it is searched again with the path to the parent directory, and so on. This is the same backtracking algorithm that is used by the MFC smartcards within the file system for keys with identifiers 0 to 3.

Version:
$Id: MFCCredentialSet.java,v 1.1 1999/12/02 16:06:01 damke Exp $

Constructor Summary
MFCCredentialSet()
          Instantiates a new credential collection for MFC smartcards.
 
Method Summary
 void deleteCredentials(CardFilePath path)
          Delete all credentials of a given domain.
 SignCredential retrieveCredential(CardFilePath path, int number)
          Retrieve a credential.
 void storeCredential(SignCredential cred, CardFilePath path, int number)
          Store a credential.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFCCredentialSet

public MFCCredentialSet()
Instantiates a new credential collection for MFC smartcards.
Method Detail

storeCredential

public void storeCredential(SignCredential cred,
                            CardFilePath path,
                            int number)
Store a credential. The path becomes part of the identifier for the credential, but it will not be cloned. If there is a chance that the path object may be changed, a copy of that object must be passed. Only absolute paths may be used to represent a key domain. This is not checked.
Parameters:
cred - the credential to store
path - the key domain for which the credential is valid
number - the key's number in it's domain
See Also:
retrieveCredential(opencard.opt.iso.fs.CardFilePath, int)

retrieveCredential

public SignCredential retrieveCredential(CardFilePath path,
                                         int number)
Retrieve a credential. If no matching credential is found for the given path, backtracking to parent directories is applied. The path object provided as argument will not be changed.
Parameters:
path - the key domain or a subdirectory within the domain
number - the key's number within it's domain
Returns:
the credential previously stored, or null if not found
See Also:
storeCredential(opencard.opt.security.SignCredential, opencard.opt.iso.fs.CardFilePath, int)

deleteCredentials

public void deleteCredentials(CardFilePath path)
Delete all credentials of a given domain. This method must be invoked if the credentials for a domain have to be replaced. After the invocation, the new credentials can be stored.
Parameters:
path - the key domain for which to delete all credentials
See Also:
storeCredential(opencard.opt.security.SignCredential, opencard.opt.iso.fs.CardFilePath, int)