com.cryptware.jsmartosapi
Class SmartOSKW

java.lang.Object
  extended by com.cryptware.jsmartosapi.SmartOS
      extended by com.cryptware.jsmartosapi.SmartOSKW

public class SmartOSKW
extends SmartOS

Class for SmartOSK1 smart cards

Author:
Ugo Chirico

Field Summary
static int ADMIN_PIN
          Admin PIN
static int MODE_FORMAT_ADMIN_PIN_ERR_COUNT
          Mode CardAdminPINErrorCounter
static int MODE_FORMAT_USER_PIN_ERR_COUNT
          Mode CardUserPINErrorCounter
static int USER_PIN
          User PIN
 
Fields inherited from class com.cryptware.jsmartosapi.SmartOS
LIFECYCLE_FORMATTED, LIFECYCLE_UNFORMATTED, MODE_CARDID, MODE_CARDINFO, MODE_CARDLIFECYCLE, MODE_FORMAT_KEY_ERR_COUNT
 
Constructor Summary
SmartOSKW(SmartCard sc)
          Constructor
 
Method Summary
 ResponseAPDU DecreaseBalance(int amount)
          DecreaseBalance Command
Decreases the balance by the specified value
 ResponseAPDU GetBalance()
          GetBalance Command
 ResponseAPDU IncreaseBalance(int amount)
          IncreaseBalance Command
Increases the balance by the specified value
 ResponseAPDU ReadOwnerData(byte hi, byte low, byte len)
          ReadOwnerData Command
Sends a Read Owner Data Command APDU with specified offset
 ResponseAPDU SetBalance(int balance)
          SetBalance Command
Set the balance to the specified value
 ResponseAPDU WriteOwnerData(byte hi, byte low, byte[] toWrite)
          WriteOwnerData Command
Sends a Write Owner Data Command APDU with specified offset and data
 
Methods inherited from class com.cryptware.jsmartosapi.SmartOS
ChangeReferenceData, Format, GetData, VerifyPIN
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_PIN

public static final int USER_PIN
User PIN

See Also:
Constant Field Values

ADMIN_PIN

public static final int ADMIN_PIN
Admin PIN

See Also:
Constant Field Values

MODE_FORMAT_USER_PIN_ERR_COUNT

public static final int MODE_FORMAT_USER_PIN_ERR_COUNT
Mode CardUserPINErrorCounter

See Also:
Constant Field Values

MODE_FORMAT_ADMIN_PIN_ERR_COUNT

public static final int MODE_FORMAT_ADMIN_PIN_ERR_COUNT
Mode CardAdminPINErrorCounter

See Also:
Constant Field Values
Constructor Detail

SmartOSKW

public SmartOSKW(SmartCard sc)
Constructor

Parameters:
sc -
Method Detail

ReadOwnerData

public ResponseAPDU ReadOwnerData(byte hi,
                                  byte low,
                                  byte len)
ReadOwnerData Command
Sends a Read Owner Data Command APDU with specified offset

Parameters:
hi - highest byte of the offset
low - offset lowest byte of the offset
len - number of bytes to read
Returns:
the response

WriteOwnerData

public ResponseAPDU WriteOwnerData(byte hi,
                                   byte low,
                                   byte[] toWrite)
WriteOwnerData Command
Sends a Write Owner Data Command APDU with specified offset and data

Parameters:
hi - highest byte of the offset
low - offset lowest byte of the offset
toWrite - bytes to write
Returns:
the response

SetBalance

public ResponseAPDU SetBalance(int balance)
SetBalance Command
Set the balance to the specified value

Parameters:
balance -
Returns:
the response

GetBalance

public ResponseAPDU GetBalance()
GetBalance Command

Returns:
the balance

IncreaseBalance

public ResponseAPDU IncreaseBalance(int amount)
IncreaseBalance Command
Increases the balance by the specified value

Parameters:
amount - Amount to add
Returns:
the response

DecreaseBalance

public ResponseAPDU DecreaseBalance(int amount)
DecreaseBalance Command
Decreases the balance by the specified value

Parameters:
amount - to subtract
Returns:
the response