jason.client
Class Ans

java.lang.Object
  |
  +--jason.client.Ans

public class Ans
extends java.lang.Object

Title: Jason As Secure Object Network

Description: Applet Name Server

Copyright: Copyright (c) 2002

Company: University of Twente


Field Summary
protected  SecureCardAccessor cardAccessor
           
protected  com.sun.javacard.javax.smartcard.rmiclient.JavaCardRMIConnect javaCardRMIConnect
           
protected  KeyStore keyStore
           
protected  java.util.Properties properties
           
 
Constructor Summary
Ans(KeyStore keyStore)
          Loads the default properties from jcrmi/client/ans.properties.
Ans(KeyStore keyStore, java.util.Properties properties)
          Sets the properties to a custom value.
 
Method Summary
 void addApplet(java.lang.String fullAppletName, byte[] aid)
          Adds a new applet to the registry.
 void addApplet(java.lang.String fullAppletName, java.lang.String aid)
          Adds a new applet to the registry.
 void deleteApplet(java.lang.String fullAppletName)
          Deletes the applet from the registry.
 java.lang.Object getApplet(java.lang.String fullAppletName, byte role)
          Gets the AID from the fullAppletName and selects the Applet.
 byte[] getAppletAID(java.lang.String fullAppletName)
          Gets the AID of an applet as a byte array.
protected  void init(KeyStore keyStore)
          Initializes the keyStore, cardAccessor and javaCardRMIConnect.
 void load(java.io.InputStream properties)
          Loads the properties from the given input stream.
 void setHost(java.lang.String hostName)
          Sets the hostname.
 void setPort(int port)
          Sets the port number.
 void store(java.io.OutputStream properties)
          Stores the properties to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Properties properties

keyStore

protected KeyStore keyStore

cardAccessor

protected SecureCardAccessor cardAccessor

javaCardRMIConnect

protected com.sun.javacard.javax.smartcard.rmiclient.JavaCardRMIConnect javaCardRMIConnect
Constructor Detail

Ans

public Ans(KeyStore keyStore)
Loads the default properties from jcrmi/client/ans.properties.


Ans

public Ans(KeyStore keyStore,
           java.util.Properties properties)
Sets the properties to a custom value.

Parameters:
keyStore - The key store to be used
properties - Properties to be used
Method Detail

init

protected void init(KeyStore keyStore)
Initializes the keyStore, cardAccessor and javaCardRMIConnect.


getApplet

public java.lang.Object getApplet(java.lang.String fullAppletName,
                                  byte role)
                           throws java.io.IOException
Gets the AID from the fullAppletName and selects the Applet. The it logs in as the specified role and gets the initial reference to the remote object.

Parameters:
fullAppletName - Name of the card object preceded with the full package name
role - Role byte in which to log in
Returns:
The initial reference to the remote object
Throws:
LoginException - when the card refuses to log in
java.io.IOException - when another IO error occurs

setHost

public void setHost(java.lang.String hostName)
Sets the hostname.

Parameters:
hostName - The host name

setPort

public void setPort(int port)
Sets the port number.

Parameters:
port - The port number

load

public void load(java.io.InputStream properties)
          throws java.io.IOException
Loads the properties from the given input stream. The stream will beclosed.

Parameters:
properties - InputStream from where the properties can be read
Throws:
java.io.IOException - when an IO error occurs

store

public void store(java.io.OutputStream properties)
           throws java.io.IOException
Stores the properties to the given output stream. The stream will be closed.

Parameters:
properties - OutputStream to where the properties can be written
Throws:
java.io.IOException - when an IO error occurs

addApplet

public void addApplet(java.lang.String fullAppletName,
                      java.lang.String aid)
Adds a new applet to the registry.

Parameters:
fullAppletName - Applet name preceded by the full package name
aid - The aid in the form 0x00:0x00:0x00:0x00:0x00

addApplet

public void addApplet(java.lang.String fullAppletName,
                      byte[] aid)
Adds a new applet to the registry.

Parameters:
fullAppletName - Applet name preceded by the full package name
aid - The aid in the form of a byte array

deleteApplet

public void deleteApplet(java.lang.String fullAppletName)
Deletes the applet from the registry.

Parameters:
fullAppletName - The applet name preceded by the full package name

getAppletAID

public byte[] getAppletAID(java.lang.String fullAppletName)
Gets the AID of an applet as a byte array.

Parameters:
fullAppletName - The applet name preceded by the full package name
Returns:
AID