ds.ov2.front
Class RSA_card_protocol_test_stubs

java.lang.Object
  extended by ds.ov2.front.RSA_card_protocol_test_stubs

public class RSA_card_protocol_test_stubs
extends Object

Stub code for running methods in the testframe on the host. Defines one stub method for each protocol step in RSA_card_protocol.id. This class is the test-frame alternative to RSA_card_protocol_stubs. It provides the same public interface, but instead of communicating with a Java Card and invoking methods there, it directly invokes the methods on the very same Java Virtual machine. This is of course only possible, if (almost) all of the applet code is available on the host. All CardChannel arguments in this class are unused.

Each stub method here performs the following actions:

  1. argument conversion (for instance from BigInteger to Bignat)
  2. running the specified action for this step
  3. result conversion
  4. 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 RSA_card_protocol.id

Nested Class Summary
static class RSA_card_protocol_test_stubs.Commit_result
          Result record for step commit of protocol gate.
static class RSA_card_protocol_test_stubs.Finish_signature_result
          Result record for step finish_signature of protocol resign.
static class RSA_card_protocol_test_stubs.Get_signature_result
          Result record for step get_signature of protocol resign.
static class RSA_card_protocol_test_stubs.Make_sig_hash_result
          Result record for step make_sig_hash of protocol resign.
static class RSA_card_protocol_test_stubs.Respond_result
          Result record for step respond of protocol gate.
 
Field Summary
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  RSA_card_protocol_description protocol_description
          A protocol description instance from RSA_card_protocol.id.
 
Constructor Summary
RSA_card_protocol_test_stubs(RSA_card_protocol_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
 void allocate_call(CardChannel _cc, int _short_bignat_size_host_arg, int _long_bignat_size_host_arg, int _attribute_length_host_arg, int _mont_correction_len_host_arg)
          Call step allocate of protocol allocate in the test environment.
 RSA_card_protocol_test_stubs.Commit_result commit_call(CardChannel _cc)
          Call step commit of protocol gate in the test environment.
 void delayed_init()
          Delayed initialization.
 RSA_card_protocol_test_stubs.Finish_signature_result finish_signature_call(CardChannel _cc, BigInteger _data_host_response_host_arg)
          Call step finish_signature of protocol resign in the test environment.
 RSA_card_protocol_test_stubs.Get_signature_result get_signature_call(CardChannel _cc)
          Call step get_signature of protocol resign in the test environment.
 void init_data_call(CardChannel _cc, Host_modulus _data_n_host_arg, BigInteger _data_ptls_key_host_arg, Host_vector _data_bases_host_arg, Host_vector _data_base_factors_host_arg, Host_vector _data_current_attributes_host_arg, BigInteger _data_montgomerized_one_host_arg, Host_vector _data_montgomery_corrections_host_arg)
          Call step init_data of protocol initialize in the test environment.
 RSA_card_protocol_test_stubs.Make_sig_hash_result make_sig_hash_call(CardChannel _cc, BigInteger _data_host_alpha_host_arg, Host_vector _data_remainders_host_arg)
          Call step make_sig_hash of protocol resign in the test environment.
 RSA_card_protocol_test_stubs.Respond_result respond_call(CardChannel _cc, BigInteger _data_gamma_beta_3_host_arg)
          Call step respond of protocol gate in the test environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_description

private RSA_card_protocol_description protocol_description
A protocol description instance from RSA_card_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.

Constructor Detail

RSA_card_protocol_test_stubs

public RSA_card_protocol_test_stubs(RSA_card_protocol_description d,
                                    PrintWriter o,
                                    boolean script)
Stub constructor. In this test-frame alternative there are no Host_protocol data structures to initialize. Therefore this constructor only saves the first two arguments into object local fields. The argument script is only there for compatibility with RSA_card_protocol_stubs, it is ignored here.

Parameters:
d - protocol description instance for RSA_card_protocol.id
o - channel for printing debugging information, pass null for disabling debugging information
script - ignored here, controls printing of apdutool lines in RSA_card_protocol_stubs
Method Detail

allocate_call

public void allocate_call(CardChannel _cc,
                          int _short_bignat_size_host_arg,
                          int _long_bignat_size_host_arg,
                          int _attribute_length_host_arg,
                          int _mont_correction_len_host_arg)
Call step allocate of protocol allocate in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
_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
_attribute_length_host_arg - argument attribute_length to be converted to APDU_short
_mont_correction_len_host_arg - argument mont_correction_len to be converted to APDU_short

init_data_call

public void init_data_call(CardChannel _cc,
                           Host_modulus _data_n_host_arg,
                           BigInteger _data_ptls_key_host_arg,
                           Host_vector _data_bases_host_arg,
                           Host_vector _data_base_factors_host_arg,
                           Host_vector _data_current_attributes_host_arg,
                           BigInteger _data_montgomerized_one_host_arg,
                           Host_vector _data_montgomery_corrections_host_arg)
Call step init_data of protocol initialize in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
_data_n_host_arg - argument data.n to be converted to Modulus
_data_ptls_key_host_arg - argument data.ptls_key to be converted to Bignat
_data_bases_host_arg - argument data.bases to be converted to Vector
_data_base_factors_host_arg - argument data.base_factors to be converted to Vector
_data_current_attributes_host_arg - argument data.current_attributes to be converted to Vector
_data_montgomerized_one_host_arg - argument data.montgomerized_one to be converted to Bignat
_data_montgomery_corrections_host_arg - argument data.montgomery_corrections to be converted to Vector

get_signature_call

public RSA_card_protocol_test_stubs.Get_signature_result get_signature_call(CardChannel _cc)
Call step get_signature of protocol resign in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
Returns:
Get_signature_result record containing all results, including the duration of the call.

make_sig_hash_call

public RSA_card_protocol_test_stubs.Make_sig_hash_result make_sig_hash_call(CardChannel _cc,
                                                                            BigInteger _data_host_alpha_host_arg,
                                                                            Host_vector _data_remainders_host_arg)
Call step make_sig_hash of protocol resign in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
_data_host_alpha_host_arg - argument data.host_alpha to be converted to Bignat
_data_remainders_host_arg - argument data.remainders to be converted to Vector
Returns:
Make_sig_hash_result record containing all results, including the duration of the call.

finish_signature_call

public RSA_card_protocol_test_stubs.Finish_signature_result finish_signature_call(CardChannel _cc,
                                                                                  BigInteger _data_host_response_host_arg)
Call step finish_signature of protocol resign in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
_data_host_response_host_arg - argument data.host_response to be converted to Bignat
Returns:
Finish_signature_result record containing all results, including the duration of the call.

commit_call

public RSA_card_protocol_test_stubs.Commit_result commit_call(CardChannel _cc)
Call step commit of protocol gate in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
Returns:
Commit_result record containing all results, including the duration of the call.

respond_call

public RSA_card_protocol_test_stubs.Respond_result respond_call(CardChannel _cc,
                                                                BigInteger _data_gamma_beta_3_host_arg)
Call step respond of protocol gate in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in RSA_card_protocol_stubs
_data_gamma_beta_3_host_arg - argument data.gamma_beta_3 to be converted to Bignat
Returns:
Respond_result record containing all results, including the duration of the call.

delayed_init

public void delayed_init()
Delayed initialization. Empty method, only here for compatibility with RSA_card_protocol_stubs. In this test-frame alternative there are no Host_protocol data structures to initialize, consequently nothing has to be done in delayed initialization