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

com.ibm.opencard.signature
Class MFC421KeyConverter

java.lang.Object
  |
  +--com.ibm.opencard.signature.MFC40KeyConverter
        |
        +--com.ibm.opencard.signature.MFC421KeyConverter

public class MFC421KeyConverter
extends MFC40KeyConverter

Create MFC4.21 specific byte stream for key files from opencard.opt.security keys. the 4.21 supports the same files as 4.0 plus DSA public and private keys

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

Constructor Summary
MFC421KeyConverter()
           
 
Method Summary
 void assertSupportsKey(java.security.PrivateKey key)
          Check if the card can store a private Key of the provided type
 void assertSupportsKey(java.security.PublicKey key)
          Check if the card can store a public Key of the provided type
 byte[] pkaFile(java.security.PrivateKey key, byte[] keyInfo)
          Returns the actual key in KeyData format specified for private key PKA files
 byte[] pkaFile(java.security.PublicKey key, byte[] keyInfo)
          Returns the actual key in KeyData format specified for public key PKA files
 java.security.PublicKey readPublicKey(MFCKeyInfo ki, byte[] fileContent)
          Construct a key from the key file content of an MFC key file Creates a subclass of java.security.PublicKey.
 
Methods inherited from class com.ibm.opencard.signature.MFC40KeyConverter
asBigInt, fingerprint, pkaInt, unsign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFC421KeyConverter

public MFC421KeyConverter()
Method Detail

assertSupportsKey

public void assertSupportsKey(java.security.PrivateKey key)
                       throws java.security.InvalidKeyException
Check if the card can store a private Key of the provided type
Throws:
java.security.InvalidKeyException - The card does not support the kind of key provided.
Overrides:
assertSupportsKey in class MFC40KeyConverter

assertSupportsKey

public void assertSupportsKey(java.security.PublicKey key)
                       throws java.security.InvalidKeyException
Check if the card can store a public Key of the provided type
Throws:
java.security.InvalidKeyException - The card does not support the kind of key provided.
Overrides:
assertSupportsKey in class MFC40KeyConverter

pkaFile

public byte[] pkaFile(java.security.PrivateKey key,
                      byte[] keyInfo)
               throws java.security.InvalidKeyException
Returns the actual key in KeyData format specified for private key PKA files
Parameters:
keyInfo - Additional key info to be merged into actual key to make it a valid PKA file.
Returns:
Byte array in a form as specified for a full-fledged PKA file
Throws:
java.security.InvalidKeyException - The card does not support the kind of key provided
Overrides:
pkaFile in class MFC40KeyConverter

pkaFile

public byte[] pkaFile(java.security.PublicKey key,
                      byte[] keyInfo)
               throws java.security.InvalidKeyException
Returns the actual key in KeyData format specified for public key PKA files
Parameters:
keyInfo - Additional key info to be merged into actual key to make it a valid PKA file.
Returns:
Byte array in a form as specified for a full-fledged PKA file
Throws:
java.security.InvalidKeyException - The card does not support the kind of key provided
Overrides:
pkaFile in class MFC40KeyConverter

readPublicKey

public java.security.PublicKey readPublicKey(MFCKeyInfo ki,
                                             byte[] fileContent)
                                      throws CardServiceException
Construct a key from the key file content of an MFC key file Creates a subclass of java.security.PublicKey.
Overrides:
readPublicKey in class MFC40KeyConverter