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

com.ibm.opencard.access
Class DESSignCredential

java.lang.Object
  |
  +--com.ibm.opencard.access.DESSignCredential
Direct Known Subclasses:
DESSecureCredential

public class DESSignCredential
extends java.lang.Object
implements SymmetricCredential, SignCredential

Sample credential to perform a DES signing operation. This credential does not hash a message nor pad input blocks which are too small. It simply performs a single-block DES encryption. This credential can be used for external authentication.

See Also:
SymmetricCredential, SignCredential

Field Summary
protected  DES des_algorithm
           
protected  byte[] des_key
           
 
Constructor Summary
DESSignCredential(DESKey key)
          Creates a new sign credential from a DES key.
 
Method Summary
 int getInputLength()
           
 byte[] sign(byte[] data)
          Computes a signature over a block of data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

des_key

protected byte[] des_key

des_algorithm

protected DES des_algorithm
Constructor Detail

DESSignCredential

public DESSignCredential(DESKey key)
Creates a new sign credential from a DES key.
Parameters:
key - the single or double length DES key
Method Detail

sign

public byte[] sign(byte[] data)
            throws CardServiceInvalidCredentialException
Computes a signature over a block of data.
Specified by:
sign in interface SignCredential
Parameters:
data - Data to be signed. Must be 8 bytes.
Throws:
CardServiceInvalidCredentialException - Invalid input block length or invalid key.

getInputLength

public int getInputLength()
Specified by:
getInputLength in interface SignCredential