ds.ov2.front
Enum Applet_type

java.lang.Object
  extended by java.lang.Enum<Applet_type>
      extended by ds.ov2.front.Applet_type
All Implemented Interfaces:
Serializable, Comparable<Applet_type>

public enum Applet_type
extends Enum<Applet_type>

Enumeration of the different RSA applets this class can deal with.

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
Hendrik Tews
Version:
$Revision: 1.5 $
Last Commit:
$Date: 2010-02-16 10:26:07 $ by $Author: tews $

Enum Constant Summary
MONT_RSA_APPLET
          ID for the Montgomerizing RSA applet.
PLAIN_RSA_APPLET
          ID for the plain RSA applet.
SQUARED_RSA_APPLET
          ID for the squaring RSA applet.
SQUARED4_RSA_APPLET
          ID for the square 4 RSA applet.
 
Method Summary
 byte[] applet_aid()
          Applet name as byte array, like an AID.
 String applet_file()
          Cap file for this applet type.
 String applet_name()
          Applet name for this applet type.
(package private) static Applet_type from_byte(byte byte_type)
          Convert the applet-type byte constants (see RSA_data.PLAIN_RSA_APPLET and RSA_data.MONT_RSA_APPLET) into this enumeration type.
 int minimal_base_size()
          Return a minimal default base size, depending on the applet type.
 boolean montgomerize()
          Decide whether the communication for this applet type is montgomerized or not.
 int montgomery_digits()
          Return the number of Montgomery digits that this applet uses.
 byte[] package_aid()
          Package name as byte array, like an AID.
 String package_name()
          Package name for this applet type.
 byte to_byte()
          Convert from this enumeration to the byte constants used in the applet code, see RSA_data.PLAIN_RSA_APPLET and RSA_data.MONT_RSA_APPLET.
static Applet_type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Applet_type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PLAIN_RSA_APPLET

public static final Applet_type PLAIN_RSA_APPLET
ID for the plain RSA applet. The plain RSA applet computes exponents with the RSA cipher but uses Java Montgomery multiplication for products. It communicates with the host by exchanging the plain, unmontgomerized numbers. Corresponds to RSA_data.PLAIN_RSA_APPLET.


MONT_RSA_APPLET

public static final Applet_type MONT_RSA_APPLET
ID for the Montgomerizing RSA applet. The Montgomerizing RSA applet computes everything on the JCVM, without the RSA cipher. It communicates with the host by exchanging montgomerized numbers. Corresponds to RSA_data.MONT_RSA_APPLET.


SQUARED_RSA_APPLET

public static final Applet_type SQUARED_RSA_APPLET
ID for the squaring RSA applet. The squaring RSA applet computes exponents and products with the RSA cipher. Products are computed with the equation x*y = ((x+y)^2 - x^2 - y^2)/2. The applet communicates with the host by exchanging the plain, unmontgomerized numbers. Corresponds to RSA_data.SQUARED_RSA_APPLET.


SQUARED4_RSA_APPLET

public static final Applet_type SQUARED4_RSA_APPLET
ID for the square 4 RSA applet. The square 4 RSA applet computes exponents and products with the RSA cipher. Products are computed with the equation x*y = ((x+y)^2 - (x-y)^2)/4. The applet communicates with the host by exchanging the plain, unmontgomerized numbers. Corresponds to RSA_data.SQUARED4_RSA_APPLET.

Method Detail

values

public static Applet_type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Applet_type c : Applet_type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Applet_type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

montgomerize

public boolean montgomerize()
Decide whether the communication for this applet type is montgomerized or not.

Returns:
true if numbers are montgomerized for this applet type

montgomery_digits

public int montgomery_digits()
Return the number of Montgomery digits that this applet uses.

Returns:
number of Montgomery digits

minimal_base_size

public int minimal_base_size()
Return a minimal default base size, depending on the applet type. Take thereby RSA cipher limitations into account.

Returns:
a minimal default base (RSA key) size

to_byte

public byte to_byte()
Convert from this enumeration to the byte constants used in the applet code, see RSA_data.PLAIN_RSA_APPLET and RSA_data.MONT_RSA_APPLET.

Returns:
Returns the byte constant that corresponds to this

from_byte

static Applet_type from_byte(byte byte_type)
Convert the applet-type byte constants (see RSA_data.PLAIN_RSA_APPLET and RSA_data.MONT_RSA_APPLET) into this enumeration type.

Parameters:
byte_type - applet-type byte
Returns:
corresponding enumeration constant
Throws:
IllegalArgumentException - if byte_type is not one of the valid constants

package_name

public String package_name()
Package name for this applet type.

Returns:
package name as string.

package_aid

public byte[] package_aid()
Package name as byte array, like an AID.

Returns:
package name as byte array

applet_name

public String applet_name()
Applet name for this applet type.

Returns:
applet name as string.

applet_aid

public byte[] applet_aid()
Applet name as byte array, like an AID.

Returns:
applet name as byte array

applet_file

public String applet_file()
Cap file for this applet type.

Returns:
path to the cap file