|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.front.Testframe
public class Testframe
Common part of the host test frame and the card test frame. The host test frame is that test frame that runs one applet and the host driver together on the standard Java Virtual Machine for easy applet debugging. The card test frame runs the host driver to talk to a real applet on a real card or emulator.
This class contains the options that are shared between all the test frames and the shared methods that realize the test loops.
Static class.
Field Summary | |
---|---|
private static RSA_card_debug |
debug_card
Stubs instance for the debug protocols. |
private static RSA_host_card |
host_card
Host driver instance for the regular protocols. |
static Option[] |
shared_options
Option array with the shared options. |
private static Reference<Boolean> |
use_applet_reset
If true reset the applet before a new personalization instead of resinstalling it. |
Constructor Summary | |
---|---|
protected |
Testframe()
Static class, object creation disabled. |
Method Summary | |
---|---|
static void |
initialize_stubs(PrintWriter out)
(Re-)Initialize the host drivers for the regular and debug protocols host_card and debug_card . |
static void |
install_applet_and_select(CardChannel card_channel,
PrintWriter out)
(Re-)Install the applet and select it. |
static void |
parse_commandline(String[] args,
Option[] additional_options,
String short_application_name)
Parse the command line for the host and the card test frames. |
static void |
test_init_resign_proof(CardChannel card_channel,
PrintWriter out,
int attribute_number,
int base_length,
int exponent_length)
Simulates the applet life for several sets of PTLS parameters for one base and exponent length. |
static void |
test_one_card_issue_ex(CardChannel card_channel,
PrintWriter out,
PrintWriter err,
PTLS_rsa_parameters ptls_params)
Simulate the life of an OV-chip applet. |
static void |
test_one_card_issue(CardChannel card_channel,
PrintWriter out,
PTLS_rsa_parameters ptls_params)
Exception wrapper for test_one_card_issue_ex . |
static void |
test_one_ptls_round(CardChannel card_channel,
PrintWriter out,
int attribute_number,
int base_length,
int exponent_length)
Simulates the life of several applets for one newly generated set of PTLS parameters. |
static void |
test_size_loop(CardChannel card_channel,
PrintWriter out,
int attribute_number,
int start_size)
Runs the applet life simulation for all base sizes from start_size up to 2048. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static RSA_host_card host_card
debug_card
) are the only
necessary thing to run the protocols. But behind them a little
object hierarchy is hiding: the stubs RSA_card_protocol_stubs
or RSA_card_protocol_test_stubs
and RSA_card_debug_stubs
or RSA_card_debug_test_stubs
, the protocols array
Front_protocols
, the protocol descriptions RSA_card_protocol_description
and RSA_card_debug_description
, and the service instance for
registered protocols Registered_protocols
.
In the host test frames the complete applet code hides behind
this stubs instance.
The stubs are initialized in initialize_stubs(java.io.PrintWriter)
. This
should be done whenever the applet is installed.
private static RSA_card_debug debug_card
host_card
for more information.
private static Reference<Boolean> use_applet_reset
public static final Option[] shared_options
Constructor Detail |
---|
protected Testframe()
Method Detail |
---|
public static void parse_commandline(String[] args, Option[] additional_options, String short_application_name)
State.update_exponent_length()
at the end in case the
base or exponent length has been changed via options.
args
- command line as received in mainadditional_options
- additional options to prepend to the
shared optionsshort_application_name
- name to print in case of a
command line parsing errorpublic static void install_applet_and_select(CardChannel card_channel, PrintWriter out) throws CardException, IOException
card_channel
- channel to the cardout
- debug and progress channel
CardException
- on communication errors
IOException
- if the applet cap file is not accessiblepublic static void initialize_stubs(PrintWriter out)
host_card
and debug_card
. Together
with these host drivers the whole protocol layer that hides
behind them is (re-)initialized. In the host test frames even
the complete applets are reinitialized.
Therefore this is somewhat the host-side counterpart for applet installation. When the applet is (re-)installed, this method should be called to (re-)install the appropriate host data structures.
out
- output channel for debug and progress messagespublic static void test_one_card_issue_ex(CardChannel card_channel, PrintWriter out, PrintWriter err, PTLS_rsa_parameters ptls_params) throws CardException, IOException
Card_testframe
.
In the card test frame the applet to install can be chosen via
options, see Card_testframe
. In the host test frame the
applet type is fixed.
This method uses the card_channel
argument to determine
whether it runs inside a host test frame. Applet deletion and
installation is only done if card_channel
is nonnull.
card_channel
- channel to the card or null for a host test frameout
- output channel for debug and progress messageserr
- output channel for serious problemsptls_params
- PTLS parameters instance
CardException
- on communication errors
IOException
- if the applet cap file is not accessiblepublic static void test_one_card_issue(CardChannel card_channel, PrintWriter out, PTLS_rsa_parameters ptls_params) throws CardException, IOException
test_one_card_issue_ex
. Simulates the life of an OV-chip
applet and catches the exception that is raised when the card
guesses one of the secret factors of the RSA modulus when
generating a new random blinding. This can actually be easily
observed for RSA key sizes below 16 bits. If the card guesses
one of the factors some response is not invertible any more and
BigInteger.modInverse(java.math.BigInteger)
throws and ArithmeticException
.
All other exceptions are not touched.
card_channel
- channel to the card or null for a host test frameout
- output channel for debug and progress messagesptls_params
- PTLS parameters instance
CardException
- on communication errors
IOException
- if the applet cap file is not accessiblepublic static void test_one_ptls_round(CardChannel card_channel, PrintWriter out, int attribute_number, int base_length, int exponent_length) throws NoSuchAlgorithmException, CardException, IOException
Card_testframe
.
card_channel
- channal to the card or null for the host
test frameout
- output channel for progress and debug messagesattribute_number
- number of attributes to usebase_length
- length of the RSA key and the basesexponent_length
- length of the attributes and the public
RSA exponent
CardException
- on communication errors
IOException
- if the applet cap file is not accessible
NoSuchAlgorithmException
- if no provider for RSA key
generation can be foundpublic static void test_init_resign_proof(CardChannel card_channel, PrintWriter out, int attribute_number, int base_length, int exponent_length) throws NoSuchAlgorithmException, CardException, IOException
Card_testframe
.
card_channel
- channal to the card or null for the host
test frameout
- output channel for progress and debug messagesattribute_number
- number of attributes to usebase_length
- length of the RSA key and the basesexponent_length
- length of the attributes and the public
RSA exponent
CardException
- on communication errors
IOException
- if the applet cap file is not accessible
NoSuchAlgorithmException
- if no provider for RSA key
generation can be foundpublic static void test_size_loop(CardChannel card_channel, PrintWriter out, int attribute_number, int start_size) throws NoSuchAlgorithmException, CardException, IOException
start_size
up to 2048.
card_channel
- channal to the card or null for the host
test frameout
- output channel for progress and debug messagesattribute_number
- number of attributes to usestart_size
- base start size in bits
CardException
- on communication errors
IOException
- if the applet cap file is not accessible
NoSuchAlgorithmException
- if no provider for RSA key
generation can be found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |