jason.server
Class KeyStore

java.lang.Object
  |
  +--jason.server.KeyStore

public class KeyStore
extends java.lang.Object

Title: Javacards As Secure Object Store

Description: KeyStore to be used inside a Javacard

Copyright: Copyright (c) 2002

Company: University of Twente


Field Summary
 byte[] freshnessCounters
           
private  Key[] keys
           
private  byte[] sessionAlgorithms
           
 
Constructor Summary
KeyStore(short numberOfRoles)
          Makes a new key store containing numberOfRoles keys.
 
Method Summary
 Key getKey(byte role)
          Returns the key corresponding to the role.
 boolean setKey(byte role, Key key, byte sessionAlgorithm)
          Sets a new entry for a new role
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keys

private Key[] keys

sessionAlgorithms

private byte[] sessionAlgorithms

freshnessCounters

public byte[] freshnessCounters
Constructor Detail

KeyStore

public KeyStore(short numberOfRoles)
Makes a new key store containing numberOfRoles keys.

Parameters:
numberOfRoles - Size of the internal Key[]
Method Detail

getKey

public Key getKey(byte role)
Returns the key corresponding to the role.

Parameters:
role - Role byte
Returns:
Corresponding key

setKey

public boolean setKey(byte role,
                      Key key,
                      byte sessionAlgorithm)
Sets a new entry for a new role

Parameters:
role - The role value (constant of the generated interface)
key - Some key
sessionAlgorithm - A value from KeyBuiler.TYPE_...
Returns:
false if the key cannot be set, true otherwise