ds.ov2.front
Class RSA_card_protocol_stubs

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

public class RSA_card_protocol_stubs
extends Object

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

Nested Class Summary
static class RSA_card_protocol_stubs.Commit_result
          Result record for step commit of protocol gate.
static class RSA_card_protocol_stubs.Finish_signature_result
          Result record for step finish_signature of protocol resign.
static class RSA_card_protocol_stubs.Get_signature_result
          Result record for step get_signature of protocol resign.
static class RSA_card_protocol_stubs.Make_sig_hash_result
          Result record for step make_sig_hash of protocol resign.
static class RSA_card_protocol_stubs.Respond_result
          Result record for step respond of protocol gate.
 
Field Summary
private  Host_protocol hp_allocate
          Host protocol instance for step allocate of protocol allocate.
private  Host_protocol hp_commit
          Host protocol instance for step commit of protocol gate.
private  Host_protocol hp_finish_signature
          Host protocol instance for step finish_signature of protocol resign.
private  Host_protocol hp_get_signature
          Host protocol instance for step get_signature of protocol resign.
private  Host_protocol hp_init_data
          Host protocol instance for step init_data of protocol initialize.
private  Host_protocol hp_make_sig_hash
          Host protocol instance for step make_sig_hash of protocol resign.
private  Host_protocol hp_respond
          Host protocol instance for step respond of protocol gate.
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.
private  boolean with_apdu_script
          Controls apdutool line printing.
 
Constructor Summary
RSA_card_protocol_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 on the card.
 RSA_card_protocol_stubs.Commit_result commit_call(CardChannel _cc)
          Call step commit of protocol gate on the card.
 void delayed_init()
          Delayed initialization.
 RSA_card_protocol_stubs.Finish_signature_result finish_signature_call(CardChannel _cc, BigInteger _data_host_response_host_arg)
          Call step finish_signature of protocol resign on the card.
 RSA_card_protocol_stubs.Get_signature_result get_signature_call(CardChannel _cc)
          Call step get_signature of protocol resign on the card.
 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 on the card.
private  void init_hp_allocate(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_allocate.
private  void init_hp_commit(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_commit.
private  void init_hp_finish_signature(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_finish_signature.
private  void init_hp_get_signature(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_get_signature.
private  void init_hp_init_data(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_init_data.
private  void init_hp_make_sig_hash(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_make_sig_hash.
private  void init_hp_respond(RSA_card_protocol_description d, PrintWriter out, boolean script)
          Initialization method for hp_respond.
 RSA_card_protocol_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 on the card.
 RSA_card_protocol_stubs.Respond_result respond_call(CardChannel _cc, BigInteger _data_gamma_beta_3_host_arg)
          Call step respond of protocol gate 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 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.


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_allocate

private Host_protocol hp_allocate
Host protocol instance for step allocate of protocol allocate. Initialized via init_hp_allocate (which is called from the constructor).


hp_init_data

private Host_protocol hp_init_data
Host protocol instance for step init_data of protocol initialize. Initialized via init_hp_init_data (which is called from delayed_init()).


hp_get_signature

private Host_protocol hp_get_signature
Host protocol instance for step get_signature of protocol resign. Initialized via init_hp_get_signature (which is called from delayed_init()).


hp_make_sig_hash

private Host_protocol hp_make_sig_hash
Host protocol instance for step make_sig_hash of protocol resign. Initialized via init_hp_make_sig_hash (which is called from delayed_init()).


hp_finish_signature

private Host_protocol hp_finish_signature
Host protocol instance for step finish_signature of protocol resign. Initialized via init_hp_finish_signature (which is called from delayed_init()).


hp_commit

private Host_protocol hp_commit
Host protocol instance for step commit of protocol gate. Initialized via init_hp_commit (which is called from delayed_init()).


hp_respond

private Host_protocol hp_respond
Host protocol instance for step respond of protocol gate. Initialized via init_hp_respond (which is called from delayed_init()).

Constructor Detail

RSA_card_protocol_stubs

public RSA_card_protocol_stubs(RSA_card_protocol_description d,
                               PrintWriter o,
                               boolean script)
Stub constructor. Initializes all non-delayed host protocol instances from RSA_card_protocol.id. Delayed protocols must be initialized separately with delayed_init() at the appropriate moment.

Parameters:
d - protocol description instance for RSA_card_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_allocate

private void init_hp_allocate(RSA_card_protocol_description d,
                              PrintWriter out,
                              boolean script)
Initialization method for hp_allocate.

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

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)
                   throws CardException
Call step allocate of protocol allocate 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
_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
Throws:
CardException - in case of communication errors

init_hp_init_data

private void init_hp_init_data(RSA_card_protocol_description d,
                               PrintWriter out,
                               boolean script)
Initialization method for hp_init_data.

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

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)
                    throws CardException
Call step init_data of protocol initialize on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_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
Throws:
CardException - in case of communication errors

init_hp_get_signature

private void init_hp_get_signature(RSA_card_protocol_description d,
                                   PrintWriter out,
                                   boolean script)
Initialization method for hp_get_signature.

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

get_signature_call

public RSA_card_protocol_stubs.Get_signature_result get_signature_call(CardChannel _cc)
                                                                throws CardException
Call step get_signature of protocol resign on the card.

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

init_hp_make_sig_hash

private void init_hp_make_sig_hash(RSA_card_protocol_description d,
                                   PrintWriter out,
                                   boolean script)
Initialization method for hp_make_sig_hash.

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

make_sig_hash_call

public RSA_card_protocol_stubs.Make_sig_hash_result make_sig_hash_call(CardChannel _cc,
                                                                       BigInteger _data_host_alpha_host_arg,
                                                                       Host_vector _data_remainders_host_arg)
                                                                throws CardException
Call step make_sig_hash of protocol resign on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_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.
Throws:
CardException - in case of communication errors

init_hp_finish_signature

private void init_hp_finish_signature(RSA_card_protocol_description d,
                                      PrintWriter out,
                                      boolean script)
Initialization method for hp_finish_signature.

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

finish_signature_call

public RSA_card_protocol_stubs.Finish_signature_result finish_signature_call(CardChannel _cc,
                                                                             BigInteger _data_host_response_host_arg)
                                                                      throws CardException
Call step finish_signature of protocol resign on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_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.
Throws:
CardException - in case of communication errors

init_hp_commit

private void init_hp_commit(RSA_card_protocol_description d,
                            PrintWriter out,
                            boolean script)
Initialization method for hp_commit.

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

commit_call

public RSA_card_protocol_stubs.Commit_result commit_call(CardChannel _cc)
                                                  throws CardException
Call step commit of protocol gate on the card.

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

init_hp_respond

private void init_hp_respond(RSA_card_protocol_description d,
                             PrintWriter out,
                             boolean script)
Initialization method for hp_respond.

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

respond_call

public RSA_card_protocol_stubs.Respond_result respond_call(CardChannel _cc,
                                                           BigInteger _data_gamma_beta_3_host_arg)
                                                    throws CardException
Call step respond of protocol gate on the card.

Parameters:
_cc - communication channel to the applet, must not be null
_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.
Throws:
CardException - in case of communication errors

delayed_init

public void delayed_init()
Delayed initialization. Initialize protocols annotated with delayed protocol init in RSA_card_protocol.id.