ds.ov2.test
Class Misc_protocols_stubs

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

public class Misc_protocols_stubs
extends Object

Stub code for running methods on the card. Defines one stub method for each protocol step in Misc_protocols.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 Misc_protocols.id

Nested Class Summary
static class Misc_protocols_stubs.Mem_size_result
          Result record for step mem_size of protocol mem_size.
static class Misc_protocols_stubs.Status_result
          Result record for step status of protocol status.
 
Field Summary
private  Host_protocol hp_mem_size
          Host protocol instance for step mem_size of protocol mem_size.
private  Host_protocol hp_ping
          Host protocol instance for step ping of protocol Ping.
private  Host_protocol hp_set_size
          Host protocol instance for step set_size of protocol set_size.
private  Host_protocol hp_status
          Host protocol instance for step status of protocol status.
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  Misc_protocols_description protocol_description
          A protocol description instance from Misc_protocols.id.
private  boolean with_apdu_script
          Controls apdutool line printing.
 
Constructor Summary
Misc_protocols_stubs(Misc_protocols_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
private  void init_hp_mem_size(Misc_protocols_description d, PrintWriter out, boolean script)
          Initialization method for hp_mem_size.
private  void init_hp_ping(Misc_protocols_description d, PrintWriter out, boolean script)
          Initialization method for hp_ping.
private  void init_hp_set_size(Misc_protocols_description d, PrintWriter out, boolean script)
          Initialization method for hp_set_size.
private  void init_hp_status(Misc_protocols_description d, PrintWriter out, boolean script)
          Initialization method for hp_status.
 Misc_protocols_stubs.Mem_size_result mem_size_call(CardChannel _cc)
          Call step mem_size of protocol mem_size on the card.
 long ping_call(CardChannel _cc)
          Call step ping of protocol Ping on the card.
 void set_size_call(CardChannel _cc, int _short_bignat_size_host_arg, int _long_bignat_size_host_arg, int _double_bignat_size_host_arg, int _cipher_size_host_arg)
          Call step set_size of protocol set_size on the card.
 Misc_protocols_stubs.Status_result status_call(CardChannel _cc)
          Call step status of protocol status 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 Misc_protocols_description protocol_description
A protocol description instance from Misc_protocols.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_ping

private Host_protocol hp_ping
Host protocol instance for step ping of protocol Ping. Initialized via init_hp_ping (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_mem_size

private Host_protocol hp_mem_size
Host protocol instance for step mem_size of protocol mem_size. Initialized via init_hp_mem_size (which is called from the constructor).


hp_status

private Host_protocol hp_status
Host protocol instance for step status of protocol status. Initialized via init_hp_status (which is called from the constructor).

Constructor Detail

Misc_protocols_stubs

public Misc_protocols_stubs(Misc_protocols_description d,
                            PrintWriter o,
                            boolean script)
Stub constructor. Initializes all host protocol instances from Misc_protocols.id.

Parameters:
d - protocol description instance for Misc_protocols.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_ping

private void init_hp_ping(Misc_protocols_description d,
                          PrintWriter out,
                          boolean script)
Initialization method for hp_ping.

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

ping_call

public long ping_call(CardChannel _cc)
               throws CardException
Call step ping of protocol Ping on the card.

Parameters:
_cc - communication channel to the applet, must not be null
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_set_size

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

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

set_size_call

public void set_size_call(CardChannel _cc,
                          int _short_bignat_size_host_arg,
                          int _long_bignat_size_host_arg,
                          int _double_bignat_size_host_arg,
                          int _cipher_size_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
_short_bignat_size_host_arg - argument short_bignat_size to be converted to APDU_short
_long_bignat_size_host_arg - argument long_bignat_size to be converted to APDU_short
_double_bignat_size_host_arg - argument double_bignat_size to be converted to APDU_short
_cipher_size_host_arg - argument cipher_size to be converted to APDU_short
Throws:
CardException - in case of communication errors

init_hp_mem_size

private void init_hp_mem_size(Misc_protocols_description d,
                              PrintWriter out,
                              boolean script)
Initialization method for hp_mem_size.

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

mem_size_call

public Misc_protocols_stubs.Mem_size_result mem_size_call(CardChannel _cc)
                                                   throws CardException
Call step mem_size of protocol mem_size on the card.

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

init_hp_status

private void init_hp_status(Misc_protocols_description d,
                            PrintWriter out,
                            boolean script)
Initialization method for hp_status.

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

status_call

public Misc_protocols_stubs.Status_result status_call(CardChannel _cc)
                                               throws CardException
Call step status of protocol status on the card.

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