|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.front.RSA_card_debug
public class RSA_card_debug
Host driver code for the debug protocols of the RSA applets. The debug protocols should not be available in a real system, because they extract all attribute values from the applet. However, for the current version of the test frame and the graphical demonstrator the debug protocols are necessary, because for the random attribute updates the host driver needs to know the real attribute values.
Field Summary | |
---|---|
private Front_protocols |
front_protocols
Registered protocols instance. |
private PrintWriter |
out
Output channel for debug messages. |
private Random |
rand
Randomness source. |
RSA_card_debug_stubs |
stubs
Stubs instance for the protocol steps. |
private int |
verbosity
Verbosity level. |
Constructor Summary | |
---|---|
RSA_card_debug(Front_protocols front_protocols,
RSA_card_debug_stubs stubs,
PrintWriter out,
int verbosity)
Constructor. |
Method Summary | |
---|---|
RSA_card_debug_stubs.Get_result |
get_and_print_status(PrintWriter out,
int level,
CardChannel card_channel)
Run the status protocol to retrieve and print the applet status. |
RSA_card_debug_stubs.Get_result |
get_status(CardChannel card_channel)
Run the status protocol to retrieve the applet status. |
void |
host_side_init()
Host side initialization for delayed protocols. |
BigInteger[] |
invent_attribute_updates(PTLS_rsa_parameters params,
CardChannel card_channel)
Invent random attribute updates. |
void |
print_applet_memory(PrintWriter out,
CardChannel card_channel)
Run the mem_size protocol to retrieve and print the available memory and whether assertions are compiled in the applet. |
void |
print_card_status(PrintWriter out,
RSA_card_debug_stubs.Get_result s)
Print the status from the status protocol. |
void |
reset_applet(CardChannel card_channel)
Run the reset-applet-state protocol to reset the applet into state RSA_data.UNALLOCTED . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Front_protocols front_protocols
public final RSA_card_debug_stubs stubs
private final Random rand
private final PrintWriter out
private final int verbosity
Constructor Detail |
---|
public RSA_card_debug(Front_protocols front_protocols, RSA_card_debug_stubs stubs, PrintWriter out, int verbosity)
front_protocols
- protocol arraystubs
- of type RSA_DEBUG_PROTOCOL_STUBS,
stubs for protocol stepsout
- output channelverbosity
- verbosity levelMethod Detail |
---|
public void host_side_init()
Asserts that the host side initialization for the delayed
protocols of front_protocols
has been done before
calling this method.
public void print_card_status(PrintWriter out, RSA_card_debug_stubs.Get_result s)
out
- output channels
- result record from the status protocolpublic RSA_card_debug_stubs.Get_result get_status(CardChannel card_channel) throws CardException
card_channel
- channel to the applet
CardChannel
- on communication errors
CardException
public RSA_card_debug_stubs.Get_result get_and_print_status(PrintWriter out, int level, CardChannel card_channel) throws CardException
get_status
and print_card_status
.
out
- output channel, maybe null to supress outputlevel
- required verbosity level; only print status if
level
is greater or equal the configured verbosity
.
CardException
- for communication errorspublic void print_applet_memory(PrintWriter out, CardChannel card_channel) throws CardException
out
- output channelcard_channel
- channel to the applet
CardException
- on communication errorspublic void reset_applet(CardChannel card_channel) throws CardException
RSA_data.UNALLOCTED
. Do also reset the mirroring
host data structures.
card_channel
- channel to the applet
CardException
- on communication errorspublic BigInteger[] invent_attribute_updates(PTLS_rsa_parameters params, CardChannel card_channel) throws CardException
The random updates excercise border conditions as follows. With a probability of 5% the update is chosen such that the attribute gets the maximal possible attribute value. Also with 5% the attribute get value 0. With both 40% a random value is added or subtracted without producing an overflow.
params
- current PTLS parameter setcard_channel
- channel to the applet
params.attribute_number
updates in the range -params.v
+ 1 .. params.v
-1, inclusive
CardException
- on communication errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |