com.ibm.opencard.signature
Class MFCKeyGenService
java.lang.Object
|
+--opencard.core.service.CardService
|
+--com.ibm.opencard.service.MFCCardService
|
+--com.ibm.opencard.signature.MFCSignatureService
|
+--com.ibm.opencard.signature.MFCKeyImportService
|
+--com.ibm.opencard.signature.MFCKeyGenService
- public class MFCKeyGenService
- extends MFCKeyImportService
- implements KeyGenerationCardService
MFCKeyGenService extends the base class
MFCKeyImportService and additionally implements the
KeyGenerationCardService interface defined by OCF.
Instances of MFCKeyFenService or one of its
subclasses, which talk to a specific physical smart card, delegate
execution of the functionality defined in KeyGenerationCardService
to a (singleton) driver for that card, which implements interface
MFCKeyGenImpl for a specific card.
- Version:
- $Id: MFCKeyGenService.java,v 1.1 1999/12/02 16:06:09 damke Exp $
- See Also:
MFCCardService,
SignatureCardService
|
Constructor Summary |
MFCKeyGenService()
Creates a new key generation service for MFC smartcards.
|
| Methods inherited from class com.ibm.opencard.signature.MFCSignatureService |
initSignature,
satisfyAccessConditions,
signData,
signData,
signDataInternal,
signHash,
signHash,
signHashInternal,
verifySignedData,
verifySignedData,
verifySignedDataInternal,
verifySignedHash,
verifySignedHash,
verifySignedHashInternal |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
keyGenImpl
protected MFCKeyGenImpl keyGenImpl
- Instances of MFCSKeyGenServices share a single instance
of a card service implementation class implementing MFCKeyGenImpl.
cos
protected int cos
faImpl
protected MFCFileAccessImpl faImpl
MFCKeyGenService
public MFCKeyGenService()
- Creates a new key generation service for MFC smartcards.
The service cannot be used until it has been initialized by invoking
initialize. If this service has to be initialized as part
of a derived service, initKeyGen has to be invoked instead.
- See Also:
initialize(opencard.core.service.CardServiceScheduler, opencard.core.service.SmartCard, boolean),
initKeyGen(com.ibm.opencard.signature.MFCKeyGenParameter)
initialize
protected void initialize(CardServiceScheduler scheduler,
SmartCard smartcard,
boolean blocking)
throws CardServiceException
- Initializes this service.
This is an entry point for initializing the MFC signature service.
It invokes initKeyGen to perform the actual initialization.
Derived services must not invoke this method, but have to invoke
initKeyGen directly.
- Parameters:
scheduler - where to allocate channelssmartcard - which smartcard to contactblocking - whether operation shall be blocking- Throws:
- CardServiceException - any subclass of CardServiceException
- Overrides:
- initialize in class MFCKeyImportService
- See Also:
initKeyGen(com.ibm.opencard.signature.MFCKeyGenParameter),
MFCCardService.initialize(opencard.core.service.CardServiceScheduler, opencard.core.service.SmartCard, boolean)
initKeyGen
public final void initKeyGen(MFCKeyGenParameter parameter)
throws CardServiceException
- Initializes this service from encapsulated arguments.
This method initializes the local attributes and invokes
initKeyImport in the base class.
- Parameters:
parameter - an object encapsulating the parameters to this service- Throws:
- CardServiceException - if the initialization failed.
With the current implementation, this cannot happen.
- See Also:
MFCKeyGenParameter,
MFCKeyImportService.initKeyImport(com.ibm.opencard.signature.MFCKeyImportParameter)
generateKeyPair
public void generateKeyPair(PrivateKeyRef privateDest,
PublicKeyRef publicDest,
int strength,
java.lang.String keyAlgorithm)
throws CardServiceException,
java.security.InvalidKeyException,
CardTerminalException
- Generate a pair of PKA keys on card.
- Specified by:
- generateKeyPair in interface KeyGenerationCardService
- Throws:
- java.security.InvalidKeyException - Thrown when the key files do not match the requested strength or algorithm.
- CardServiceException - Thrown when the card does not support the requested strength or algorithm.
- CardTerminalException - any subclass of CardTerminalException
getFileAccessImpl
protected MFCFileAccessImpl getFileAccessImpl()
- get a file service implementation
readPublicKey
public java.security.PublicKey readPublicKey(PublicKeyRef publicKey,
java.lang.String keyAlgorithm)
throws CardServiceException,
java.security.InvalidKeyException,
CardTerminalException
- Read a public key that was generated on the card from the card.
- Specified by:
- readPublicKey in interface KeyGenerationCardService
- Throws:
- java.security.InvalidKeyException - Thrown when the key files do not match the requested algorithm.
- CardServiceException - any subclass of CardServiceException
- CardTerminalException - any subclass of CardTerminalException
|