ds.ov2.test
Class Data_protocol_stubs

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

public class Data_protocol_stubs
extends Object

Stub code for running methods on the card. Defines one stub method for each protocol step in Data_protocol.id. The stub methods are the top entry point into the OV-chip protocol layer for host driver code. Each stub method performs the following actions:

  1. argument conversion (for instance from BigInteger to Bignat)
  2. transfers the arguments to the card (possibly using several APDU's)
  3. invokes the right method on the card
  4. transfers the results back (again with possibly several APDU's)
  5. result conversion
  6. and finally packages several results into one tuple object

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
idl compiler
Version:
automatically generated from Data_protocol.id

Nested Class Summary
static class Data_protocol_stubs.Check_data_result
          Result record for step check_data of protocol check_data.
static class Data_protocol_stubs.Data_perf_answer_to_challenge_result
          Result record for step data_perf_answer_to_challenge of protocol data_perf_proof.
static class Data_protocol_stubs.Data_perf_proof_commit_result
          Result record for step data_perf_proof_commit of protocol data_perf_proof.
static class Data_protocol_stubs.Data_performance_send_result
          Result record for step data_performance_send of protocol data_performance_send.
 
Field Summary
private  Host_protocol hp_check_data
          Host protocol instance for step check_data of protocol check_data.
private  Host_protocol hp_data_perf_answer_to_challenge
          Host protocol instance for step data_perf_answer_to_challenge of protocol data_perf_proof.
private  Host_protocol hp_data_perf_proof_commit
          Host protocol instance for step data_perf_proof_commit of protocol data_perf_proof.
private  Host_protocol hp_data_performance_receive
          Host protocol instance for step data_performance_receive of protocol data_performance_receive.
private  Host_protocol hp_data_performance_send
          Host protocol instance for step data_performance_send of protocol data_performance_send.
private  Host_protocol hp_set_size
          Host protocol instance for step set_size of protocol set_size.
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  Data_protocol_description protocol_description
          A protocol description instance from Data_protocol.id.
private  boolean with_apdu_script
          Controls apdutool line printing.
 
Constructor Summary
Data_protocol_stubs(Data_protocol_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
 Data_protocol_stubs.Check_data_result check_data_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg, Resizable_buffer _buf_1_host_arg, Resizable_buffer _buf_2_host_arg, Resizable_buffer _buf_3_host_arg, Resizable_buffer _buf_4_host_arg)
          Call step check_data of protocol check_data on the card.
 Data_protocol_stubs.Data_perf_answer_to_challenge_result data_perf_answer_to_challenge_call(CardChannel _cc, Resizable_buffer _buf_4_host_arg)
          Call step data_perf_answer_to_challenge of protocol data_perf_proof on the card.
 Data_protocol_stubs.Data_perf_proof_commit_result data_perf_proof_commit_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg)
          Call step data_perf_proof_commit of protocol data_perf_proof on the card.
 long data_performance_receive_call(CardChannel _cc, Resizable_buffer _buf_0_host_arg)
          Call step data_performance_receive of protocol data_performance_receive on the card.
 Data_protocol_stubs.Data_performance_send_result data_performance_send_call(CardChannel _cc)
          Call step data_performance_send of protocol data_performance_send on the card.
private  void init_hp_check_data(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_check_data.
private  void init_hp_data_perf_answer_to_challenge(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_data_perf_answer_to_challenge.
private  void init_hp_data_perf_proof_commit(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_data_perf_proof_commit.
private  void init_hp_data_performance_receive(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_data_performance_receive.
private  void init_hp_data_performance_send(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_data_performance_send.
private  void init_hp_set_size(Data_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_set_size.
 int[] set_size_call(CardChannel _cc, int[] _buf_sizes_host_arg, boolean _performance_test_host_arg)
          Call step set_size of protocol set_size on the card.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_description

private Data_protocol_description protocol_description
A protocol description instance from Data_protocol.id. Used to access the host initializers, which are additional parameters for the APDU type constructors of arguments or results. Initialized in the constructor.


out

private PrintWriter out
The output channel for debugging information of the OV-chip protocol layer. Initialized in the constructor.


with_apdu_script

private boolean with_apdu_script
Controls apdutool line printing. Initialized in the constructor, if true, the OV-chip protocol layer prints apdutool lines as part of its debugging output.


hp_check_data

private Host_protocol hp_check_data
Host protocol instance for step check_data of protocol check_data. Initialized via init_hp_check_data (which is called from the constructor).


hp_set_size

private Host_protocol hp_set_size
Host protocol instance for step set_size of protocol set_size. Initialized via init_hp_set_size (which is called from the constructor).


hp_data_performance_receive

private Host_protocol hp_data_performance_receive
Host protocol instance for step data_performance_receive of protocol data_performance_receive. Initialized via init_hp_data_performance_receive (which is called from the constructor).


hp_data_performance_send

private Host_protocol hp_data_performance_send
Host protocol instance for step data_performance_send of protocol data_performance_send. Initialized via init_hp_data_performance_send (which is called from the constructor).


hp_data_perf_proof_commit

private Host_protocol hp_data_perf_proof_commit
Host protocol instance for step data_perf_proof_commit of protocol data_perf_proof. Initialized via init_hp_data_perf_proof_commit (which is called from the constructor).


hp_data_perf_answer_to_challenge

private Host_protocol hp_data_perf_answer_to_challenge
Host protocol instance for step data_perf_answer_to_challenge of protocol data_perf_proof. Initialized via init_hp_data_perf_answer_to_challenge (which is called from the constructor).

Constructor Detail

Data_protocol_stubs

public Data_protocol_stubs(Data_protocol_description d,
                           PrintWriter o,
                           boolean script)
Stub constructor. Initializes all host protocol instances from Data_protocol.id.

Parameters:
d - protocol description instance for Data_protocol.id
o - channel for printing debugging information, pass null for disabling debugging information
script - if true, print apdutool lines for all APDUs as part of the debugging information.
Method Detail

init_hp_check_data

private void init_hp_check_data(Data_protocol_description d,
                                PrintWriter out,
                                boolean script)
Initialization method for hp_check_data.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

check_data_call

public Data_protocol_stubs.Check_data_result check_data_call(CardChannel _cc,
                                                             Resizable_buffer _buf_0_host_arg,
                                                             Resizable_buffer _buf_1_host_arg,
                                                             Resizable_buffer _buf_2_host_arg,
                                                             Resizable_buffer _buf_3_host_arg,
                                                             Resizable_buffer _buf_4_host_arg)
                                                      throws CardException
Call step check_data of protocol check_data on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_buf_0_host_arg - argument buf_0
_buf_1_host_arg - argument buf_1
_buf_2_host_arg - argument buf_2
_buf_3_host_arg - argument buf_3
_buf_4_host_arg - argument buf_4
Returns:
Check_data_result record containing all results, including the duration of the call.
Throws:
CardException - in case of communication errors

init_hp_set_size

private void init_hp_set_size(Data_protocol_description d,
                              PrintWriter out,
                              boolean script)
Initialization method for hp_set_size.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

set_size_call

public int[] set_size_call(CardChannel _cc,
                           int[] _buf_sizes_host_arg,
                           boolean _performance_test_host_arg)
                    throws CardException
Call step set_size of protocol set_size on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_buf_sizes_host_arg - argument buf_sizes to be converted to APDU_short_array
_performance_test_host_arg - argument performance_test to be converted to APDU_boolean
Returns:
result buf_sizes converted from APDU_short_array
Throws:
CardException - in case of communication errors

init_hp_data_performance_receive

private void init_hp_data_performance_receive(Data_protocol_description d,
                                              PrintWriter out,
                                              boolean script)
Initialization method for hp_data_performance_receive.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

data_performance_receive_call

public long data_performance_receive_call(CardChannel _cc,
                                          Resizable_buffer _buf_0_host_arg)
                                   throws CardException
Call step data_performance_receive of protocol data_performance_receive on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_buf_0_host_arg - argument buf_0
Returns:
Duration of the call in nanoseconds. The measurement includes (de-)serialization but not the allocation of argument and result arrays.
Throws:
CardException - in case of communication errors

init_hp_data_performance_send

private void init_hp_data_performance_send(Data_protocol_description d,
                                           PrintWriter out,
                                           boolean script)
Initialization method for hp_data_performance_send.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

data_performance_send_call

public Data_protocol_stubs.Data_performance_send_result data_performance_send_call(CardChannel _cc)
                                                                            throws CardException
Call step data_performance_send of protocol data_performance_send on the card.

Parameters:
_cc - communication channel to the applet, must not be null
Returns:
Data_performance_send_result record containing all results, including the duration of the call.
Throws:
CardException - in case of communication errors

init_hp_data_perf_proof_commit

private void init_hp_data_perf_proof_commit(Data_protocol_description d,
                                            PrintWriter out,
                                            boolean script)
Initialization method for hp_data_perf_proof_commit.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

data_perf_proof_commit_call

public Data_protocol_stubs.Data_perf_proof_commit_result data_perf_proof_commit_call(CardChannel _cc,
                                                                                     Resizable_buffer _buf_0_host_arg)
                                                                              throws CardException
Call step data_perf_proof_commit of protocol data_perf_proof on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_buf_0_host_arg - argument buf_0
Returns:
Data_perf_proof_commit_result record containing all results.
Throws:
CardException - in case of communication errors

init_hp_data_perf_answer_to_challenge

private void init_hp_data_perf_answer_to_challenge(Data_protocol_description d,
                                                   PrintWriter out,
                                                   boolean script)
Initialization method for hp_data_perf_answer_to_challenge.

Parameters:
d - description instance for Data_protocol.id
out - the debugging out channel, null for disabling debugging output
script - whether this step prints apdutool lines

data_perf_answer_to_challenge_call

public Data_protocol_stubs.Data_perf_answer_to_challenge_result data_perf_answer_to_challenge_call(CardChannel _cc,
                                                                                                   Resizable_buffer _buf_4_host_arg)
                                                                                            throws CardException
Call step data_perf_answer_to_challenge of protocol data_perf_proof on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_buf_4_host_arg - argument buf_4
Returns:
Data_perf_answer_to_challenge_result record containing all results.
Throws:
CardException - in case of communication errors