ds.ov2.test
Class Data_protocol_card

java.lang.Object
  extended by ds.ov2.test.Data_protocol_card

public class Data_protocol_card
extends Object

Card functionality for the data protocols of Data_protocol.id.

CPP Preprocessing
This class uses the following cpp defines: PACKAGE, PUBLIC
Execution Environment:
card
Author:
Hendrik Tews
Version:
$Revision: 1.8 $
Last Commit:
$Date: 2009-04-22 08:04:55 $ by $Author: tews $

Constructor Summary
Data_protocol_card()
          Empty constructor.
 
Method Summary
private  byte check_buffer(Resizable_buffer b, byte count)
          Check if the buffer b contains the expected data-check pattern.
 void check(Resizable_buffer a1, Resizable_buffer a2, Resizable_buffer a3, Resizable_buffer a4, Resizable_buffer a5, Resizable_buffer b1, Resizable_buffer b2, Resizable_buffer b3, Resizable_buffer b4, Resizable_buffer b5)
          Check and fill all 10 buffers.
private  byte fill_buffer(Resizable_buffer b, byte count)
          Fill the buffer with the data-check pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data_protocol_card

Data_protocol_card()
Empty constructor.

Method Detail

check_buffer

private byte check_buffer(Resizable_buffer b,
                          byte count)
Check if the buffer b contains the expected data-check pattern. The host fills the buffer with the consecutive numbers from 0 to 255, repeated as often as necessary over all arguments it sends to the card. This method checks if this pattern arrived here in the applet.

Parameters:
b - buffer to check
count - start value for the first byte of the buffer
Returns:
the next expected byte contents for the first byte of the next buffer to check
Throws:
ISOException - with value Response_status.OV_TEST_FAILED_00 | 0x01 in case the buffer contains unexpected data.

fill_buffer

private byte fill_buffer(Resizable_buffer b,
                         byte count)
Fill the buffer with the data-check pattern. The data-check pattern consists of the consecutive numbers from 0 to 255, repeated as often as encessary over all arguments or results.

Parameters:
b - buffer to fill
count - start value for the first byte of b
Returns:
the first byte for the next buffer

check

public void check(Resizable_buffer a1,
                  Resizable_buffer a2,
                  Resizable_buffer a3,
                  Resizable_buffer a4,
                  Resizable_buffer a5,
                  Resizable_buffer b1,
                  Resizable_buffer b2,
                  Resizable_buffer b3,
                  Resizable_buffer b4,
                  Resizable_buffer b5)
Check and fill all 10 buffers. This method checks if all argument buffers contain the data-check pattern and writes this pattern into the result buffers.

Parameters:
a1 - argument buffer
a2 - argument buffer
a3 - argument buffer
a4 - argument buffer
a5 - argument buffer
b1 - result buffers
b2 - result buffers
b3 - result buffers
b4 - result buffers
b5 - result buffers