ds.ov2.front
Class Card_testframe

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

public class Card_testframe
extends Object

Main class of the front office testframe. This test frame can install and personalize all variants of the RSA applet, namely the plain RSA applet, the Montgomerizing RSA applet, the squaring and the square 4 RSA applet. It installs both, on Java Card or the jcop emulator. Further it tests the resign and the proof protocols and measures their performance for different key sizes.

This test frame is a non-interactive terminal program whose behavior can be controlled by command line options. One can select between two kinds of modes:

-test-const
Test a fixed key size.
-test-size
Test loop with increasing key size.
The test is organized in a number of nested loops. For this test frame, which communicates with a Card or an emulator, the defaults are 3 PTLS rounds per key size, 1 card initialization round per PTLS parameter set, 3 resign rounds per applet, and 2 proof rounds per resign round. (The host test frames have different defaults.)

This test frame accepts the following options for customization.

-mont
Install and test the Montgomerizing RSA applet [default].
-plain
Install and test the plain RSA applet.
-square
Install and test the squaring RSA applet.
-square4
Install and test the square 4 RSA applet.
-base-length n
Set key length to n bits, which will be identical to the base size. If the exponent length has not been set before automatically adapts the exponent length according to Lenstra's "Key length" estimations.
-exp-length n
Set exponent length to n bits.
-attr n
Set number of attributes that the card receives during personalization.
-ptls-rounds n
Number of ptls key generation rounds.
-card-init-rounds n
Number of card initialization rounds.
-resign-rounds n
Number of resigning rounds.
-proof-rounds n
Number of proof rounds.
-768
Use the RSA 768 factorization of 2009 to calibrate the security parameter estimation
-ignore
Ignore all wrong certificates and proofs.
-jcop
Connect to jcop emulator (default if the the necessary libraries are present at runtime)
-jcop-port p
Set the port number for the jcop emulator (default 8015).
-sun
Connect to a SUN emulator
-c
Connect to a real card in the first card reader found (default if the libraries for connecting to the jcop emulator are not present).
-r n
Connect to a real card in card reader number n.
-list-readers
List all connected readers.
-i n
Provide decimal n as input for the test.
-hex n
Provide hexadecimal n as input for the test.
-h
Print usage information.
-d, -dd, -ddd
Print debug and progress messages, the more d's the more messages.
The measurments for the resign and proof protocol are interspersed in the output. To produce gnuplot charts the output must probably be filtered, see the subdirectory front/Measurements for examples.

The test frame can connect to the SUN emulators cref and jcwde too. This would even be an option for the Montgomerizing RSA applet. However, the builtin applet installation does not work with these emulators ...

Normally the host driver checks all signatures from the card and the acceptance condition during the proof protocol. If any of these checks fails the test frame terminates immediately. With the option -ignore the test frame continues when these checks fail. This is useful for the performance measurement of incorrect applets (that have, for instance, been compiled with MONTGOMERY_MULT_SHORTCUT).

This class contains the special parts for the card test frame. Many parts that are shared with the host test frames (Host_testframe) are contained in Testframe.

Static class.

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
Hendrik Tews
Version:
$Revision: 1.25 $
Last Commit:
$Date: 2010-03-12 15:40:20 $ by $Author: tews $

Field Summary
private static Reference<Integer> card_reader_number
          Index of the card reader to use.
static Option[] card_test_frame_options
          Option array with the special options of the card test frame.
private static Reference<Integer> jcop_port_number
          The port number used for the jcop emulator.
static String long_application_name
          Long application name.
private static Reference<Boolean> run_list_readers
          Whether to list all connected card readers.
static String short_application_name
          Short application name for error messages.
private static Reference<Card_terminal.Terminal_type> terminal_type
          Terminal type to use.
private static Card_terminal.Terminal_type terminal_type_default
          Default terminal.
 
Constructor Summary
protected Card_testframe()
          Static class, object creation disabled.
 
Method Summary
static void main(String[] args)
          Main method of the card test frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

short_application_name

public static final String short_application_name
Short application name for error messages.

See Also:
Constant Field Values

long_application_name

public static final String long_application_name
Long application name.

See Also:
Constant Field Values

terminal_type_default

private static final Card_terminal.Terminal_type terminal_type_default
Default terminal. If the right libraries are present the jcop emulator is the default, otherwise a PCSC card reader.


terminal_type

private static Reference<Card_terminal.Terminal_type> terminal_type
Terminal type to use. Set by options -jcop, -sun, -r and -c.


jcop_port_number

private static Reference<Integer> jcop_port_number
The port number used for the jcop emulator.


card_reader_number

private static Reference<Integer> card_reader_number
Index of the card reader to use. Set by option -r.


run_list_readers

private static Reference<Boolean> run_list_readers
Whether to list all connected card readers. Set by option -list-readers.


card_test_frame_options

public static Option[] card_test_frame_options
Option array with the special options of the card test frame.

Constructor Detail

Card_testframe

protected Card_testframe()
Static class, object creation disabled.

Method Detail

main

public static void main(String[] args)
                 throws NoSuchAlgorithmException,
                        CardException,
                        IOException
Main method of the card test frame. First sets the global variables that determine various rounds in the applet life simulation to somewhat lower values. Then parse the command line options and run the actions that have been requested.

Parameters:
args - command line arguments
Throws:
CardException - on communication errors
IOException - if the applet cap file is not accessible
NoSuchAlgorithmException - if no provider for RSA key generation can be found