|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.gui.Card_protocols
public class Card_protocols
Basic card/applet actions of the graphical demonstrator. This includes running the protocols but also applet installation, deletion and querying the card status. Additionally, this class contains actions for managing PTLS parameter sets.
Field Summary | |
---|---|
(package private) RSA_card_debug |
debug_card
RSA debug protocol instance. |
(package private) RSA_host_card |
host_card
RSA host protocols instance. |
private PTLS_rsa_parameters |
ptls_parameters
PTLS parameter instance. |
Constructor Summary | |
---|---|
Card_protocols()
Constructor. |
Method Summary | |
---|---|
void |
clear_parameters()
Clear the current set of PTLS parameters. |
void |
delete_applets(Printable_aid[] aids,
Gui_protocol_messages messages)
Delete applets and/or packages from the card. |
boolean |
entry_gate_check(Applet_type applet_type,
Gui_protocol_messages messages)
Run the entry-gate proof protocol. |
void |
generate_ptls_parameters(int attribute_number,
int key_size,
int exp_size,
Applet_type applet_type)
Generate a new set of PTLS parameters. |
int |
get_attribute_number()
Return the number of attributes. |
BigInteger[] |
get_bases()
Return the array of bases. |
private CardChannel |
get_card_channel()
Open the default channel to the card in the configured card reader. |
cardservices.AIDRegistry |
get_card_status()
Get the registry of all installed applets/packages from the card. |
private cardservices.GlobalPlatformService |
get_gps(CardChannel channel)
Open a connection to the global platform manager on the card. |
BigInteger |
get_max_base()
Return the maximal possible base value. |
private void |
install_applet_with_gps(cardservices.GlobalPlatformService gps,
Applet_type applet_type,
Gui_protocol_messages messages)
Install one of the OV-Chip applets on a card. |
void |
install_applet(Applet_type applet_type,
Gui_protocol_messages messages)
Install one of the OV-chip applets. |
boolean |
issue(CardChannel channel,
Gui_protocol_messages messages,
Applet_type applet_type)
Run the applet initialization protocol. |
void |
personalize(Applet_type applet_type,
Gui_protocol_messages messages)
Personalize the applet. |
int[] |
read_ptls_parameters(String file_name,
Applet_type applet_type)
Read PTLS parameters from file |
void |
reinstall_personalize(Applet_type applet_type,
Gui_protocol_messages messages)
Reinstall and personalize applet. |
void |
reset_applet(Applet_type applet_type)
Reset the applet. |
boolean |
resign_with_update(Applet_type applet_type,
BigInteger[] updates_bi,
Gui_protocol_messages messages)
Run the resign protocol with the specified attribute updates. |
void |
save_ptls_parameters(String file_name)
Save the current PTLS parameters to file. |
void |
update_bases(BigInteger[] new_bases)
Update the bases in the PTLS parameters. |
boolean |
valid_parameters()
Check whether we have a set of PTLS parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PTLS_rsa_parameters ptls_parameters
RSA_host_card host_card
RSA_card_debug debug_card
Constructor Detail |
---|
public Card_protocols()
Method Detail |
---|
public boolean valid_parameters()
public void clear_parameters()
public void generate_ptls_parameters(int attribute_number, int key_size, int exp_size, Applet_type applet_type) throws NoSuchAlgorithmException
attribute_number
- number of bases and attributes to usekey_size
- RSA key size in bitsexp_size
- exponent size in bitsapplet_type
- the applet type (needed somewhere for the
number of Montgomery digits)
NoSuchAlgorithmException
public void save_ptls_parameters(String file_name) throws PTLS_rsa_parameters.PTLS_io_exception
file_name
- file to use
PTLS_rsa_parameters.PTLS_io_exception
- on I/O errorspublic int[] read_ptls_parameters(String file_name, Applet_type applet_type) throws PTLS_rsa_parameters.PTLS_io_exception
file_name
- the file name to readapplet_type
- the applet type for which the protocol layer
should be initialized
PTLS_rsa_parameters.PTLS_io_exception
- on I/O errorspublic BigInteger get_max_base()
public int get_attribute_number()
NullPointerException
- if there are no valid parameterspublic BigInteger[] get_bases()
public void update_bases(BigInteger[] new_bases)
new_bases
- the new bases to use from now onprivate CardChannel get_card_channel() throws CardException
Must be executed on the Terminal thread.
CardException
- on communication problems with the cardprivate cardservices.GlobalPlatformService get_gps(CardChannel channel) throws CardException
Must be executed on the Terminal thread.
channel
- channel to the card
CardException
- for communication problems and global
platform errorspublic cardservices.AIDRegistry get_card_status() throws CardException
CardException
- on communication errorsprivate void install_applet_with_gps(cardservices.GlobalPlatformService gps, Applet_type applet_type, Gui_protocol_messages messages) throws cardservices.GlobalPlatformInstallForLoadException, cardservices.GlobalPlatformLoadException, CardException, IOException
Must be executed on the Terminal thread.
gps
- global platform service instanceapplet_type
- denotes the applet to installmessages
- progress message instance
cardservices.GlobalPlatformInstallForLoadException
- if the
install-for-load command fails
cardservices.GlobalPlatformLoadException
- if cap file loading fails
CardException
- for low-level communication errors
IOException
- if the cap file cannot be openedpublic void install_applet(Applet_type applet_type, Gui_protocol_messages messages) throws cardservices.GlobalPlatformInstallForLoadException, cardservices.GlobalPlatformLoadException, CardException, IOException
applet_type
- the applet to installmessages
- progress message instance
cardservices.GlobalPlatformInstallForLoadException
- if the
install-for-load command fails
cardservices.GlobalPlatformLoadException
- if cap file loading fails
CardException
- for low-level communication errors
IOException
- if the cap file cannot be openedpublic void delete_applets(Printable_aid[] aids, Gui_protocol_messages messages) throws CardException
aids
- the ID's to deletemessages
- progress message instance
CardException
- on communication errorspublic void reset_applet(Applet_type applet_type) throws CardException
applet_type
- the applet to reset
CardException
- on communication errorspublic void personalize(Applet_type applet_type, Gui_protocol_messages messages) throws CardException
applet_type
- the applet to personalizemessages
- progress message instance
CardException
- on communication errorspublic void reinstall_personalize(Applet_type applet_type, Gui_protocol_messages messages) throws cardservices.GlobalPlatformInstallForLoadException, cardservices.GlobalPlatformLoadException, CardException, IOException
applet_type
- the applet to reinstallmessages
- progress message instance
cardservices.GlobalPlatformInstallForLoadException
- if the
install-for-load command fails
cardservices.GlobalPlatformLoadException
- if cap file loading fails
CardException
- for low-level communication errors
IOException
- if the cap file cannot be openedpublic boolean issue(CardChannel channel, Gui_protocol_messages messages, Applet_type applet_type) throws CardException
channel
- channel to the cardmessages
- progress message instanceapplet_type
- the applet to initialize
CardException
- on communication errorspublic boolean resign_with_update(Applet_type applet_type, BigInteger[] updates_bi, Gui_protocol_messages messages) throws CardException
updates_bi
parameter is null random attribute
updates are invented via RSA_card_debug.invent_attribute_updates
.
applet_type
- the applet to select for resigningupdates_bi
- pass null for random attribute updates,
otherwise pass an array with with ptls_parameters
.attribute_number
attribute updates in the range of -ptls_parameters
.v
+ 1 .. ptls_parameters
.v
-1messages
- progress message object
CardException
- on communication errorspublic boolean entry_gate_check(Applet_type applet_type, Gui_protocol_messages messages) throws CardException
applet_type
- applet to select for provingmessages
- progress message instance
CardException
- on communication errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |