com.ibm.opencard.access
Class MFCPKAuthenticator
java.lang.Object
|
+--com.ibm.opencard.access.MFCSecurityHelper
|
+--com.ibm.opencard.access.MFC35Authenticator
|
+--com.ibm.opencard.access.MFCPKAuthenticator
- public class MFCPKAuthenticator
- extends MFC35Authenticator
An authenticator for MFC 4.0 and above smartcards that support PKA
keys for authentication
This helper of MFCCardAccessor is responsible to
authenticate an application to the smartcard. It uses the
MFC card's external authenticate command to do this.
The key required for the respective authentication number
has to be provided by the application as a SignCredential.
- Version:
- $Id: MFCPKAuthenticator.java,v 1.1 1999/12/02 16:06:01 damke Exp $
- See Also:
SignCredential
|
Constructor Summary |
MFCPKAuthenticator(MFCCodes codes,
int cos)
Instantiates a new authenticator for MFC 4.0 and above PKA smartcards. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
MFCPKAuthenticator
public MFCPKAuthenticator(MFCCodes codes,
int cos)
- Instantiates a new authenticator for MFC 4.0 and above PKA smartcards.
- Parameters:
codes - the command codes for the smartcard
getMFCSigCodes
protected final MFCSigCodes getMFCSigCodes()
- Returns the PKA command codes for the smartcard.
- Returns:
- the card-specific PKA command codes passed to the constructor
getKIParser
protected final MFCKeyInfoRParser getKIParser()
- Returns the card specific key info parser
getKeyInfoImpl
protected final MFCSignatureImpl getKeyInfoImpl()
- Returs the card specific impl to read key info
performAuthentication
public boolean performAuthentication(MFCCardChannel channel,
int number)
throws CardServiceInvalidCredentialException,
CardServiceUnexpectedResponseException,
CardTerminalException
- Performs external authentication.
- Parameters:
channel - the contact to the smartcardnumber - the identifier of the authentication key- Throws:
- CardServiceInvalidCredentialException - The authentication was not accepted since the key
used is wrong or blocked.
- CardServiceUnexpectedResponseException - The authentication failed due to some other reason.
- CardTerminalException - The terminal encountered an error.
- Overrides:
- performAuthentication in class MFC35Authenticator
zeroPadding
protected final byte[] zeroPadding(byte[] data,
int length)
- Perform zero padding
pkcs1Padding
protected final byte[] pkcs1Padding(byte[] data,
int length)
- Perform pkcs#1 padding
isoPadding
protected final byte[] isoPadding(byte[] pbIn,
int cbOut)
- perform iso 9796 padding
ported from C code obtained from Michael Deindl
- Parameters:
pbIn - data to be paddedcbOut - length of data after padding- Returns:
- padded byte array
|