Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## spki.demo
Class Monitor

    java.lang.Object
      |
      +--spki.demo.Monitor

public class Monitor
extends Object

spki.demo Monitor class.

Version:
  $Id: Monitor.java,v 1.4 2002/07/25 17:51:41 tep Exp $
Author:
  Tep Narula <tep@win.trlabs.ca>

Field Summary
`private static String` | `__ME` This class's full name.
`private Tag` | `capability`
`private String` | `db_id`
`private static String` | `DBPATH` databases's pathname prefix.
`static int` | `DEFAULT_KEY_LENGTH`
`static String` | `DEFAULT_PUB_ALG`
`private PublicKey` | `issuer` the trusted issuer's principal.
`private static String` | `ISSUER_DBKEY` the issuer's database index key.
`private int` | `key_length` the key-length in bits.
`private static String` | `KEY_LENGTH_DBKEY` the key-length's database index key.
`private String` | `keyid` the key-chain master key-pair's key-id.
`private HashDB` | `main_db` the main database object.
`private static String` | `MAIN_DBNAME` the main database filename suffix.
`private static String` | `MASTER_KEYPAIR_DBKEY` the monitor's key-pair's database index key.
`private Vector` | `nonces`
`private PrivateKey` | `privkey` the certifider's private key.
`private String` | `pub_alg` the public-key algorithm-id.
`private static String` | `PUB_ALG_DBKEY` the public-key algorithm-id's database index key.
`private PublicKey` | `pubkey` the monitor's public key.
`private int` | `state`
`static int` | `STATE_ALIVE`
`static int` | `STATE_DEAD`
`static String[]` | `STATES`

Constructor Summary
`protected` | `Monitor()` Default constructor.
`` | `Monitor(PublicKey issuer, Tag capability)` Create a brand new monitor, using the default algorithm, key-length and specified issuer.
`` | `Monitor(String db_id)` Restore a live monitor with the specified database id.
`` | `Monitor(String pub_alg, int key_length, PublicKey issuer, Tag capability)` Create a brand new monitor, using the specified algorithm, key-length and issuer.

Method Summary
`Tag` | `authorize(AuthorizationRequest request)` verify the given authorization request and issue the authorization result.
`private String` | `buildDBname(String dbname)`
`private void` | `closeDB()` to be used by the finalize() method only!
`private void` | `construct()`
`protected void` | `finalize()`
`Tag` | `getCapability()` get this monitor's accepted capability.
`String` | `getDBId()` get this monitor's id.
`PublicKey` | `getIssuer()` get this monitor's trusted issuer's public key.
`PublicKey` | `getMasterKey()` get this monitor's public key.
`int` | `getState()` get the current state.
`Sexp` | `newNonce()` generate a unique authorization nonce and save in the active nonce list.
`private void` | `openDB()` to be used by construct() and restore() only!
`void` | `restore(String db_id)` restore a monitor from the database with the given db-id.

Methods inherited from class java.lang.Object
`, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### __ME

    private static final String __ME

  This class's full name.

### DBPATH

    private static final String DBPATH

  databases's pathname prefix.

### MAIN_DBNAME

    private static final String MAIN_DBNAME

  the main database filename suffix.

### main_db

    private HashDB main_db

  the main database object.

### db_id

    private String db_id

### MASTER_KEYPAIR_DBKEY

    private static final String MASTER_KEYPAIR_DBKEY

  the monitor's key-pair's database index key.

### PUB_ALG_DBKEY

    private static final String PUB_ALG_DBKEY

  the public-key algorithm-id's database index key.

### KEY_LENGTH_DBKEY

    private static final String KEY_LENGTH_DBKEY

  the key-length's database index key.

### pubkey

    private PublicKey pubkey

  the monitor's public key.

### privkey

    private PrivateKey privkey

  the certifider's private key.

### keyid

    private String keyid

  the key-chain master key-pair's key-id.

### ISSUER_DBKEY

    private static final String ISSUER_DBKEY

  the issuer's database index key.

### issuer

    private PublicKey issuer

  the trusted issuer's principal.

### DEFAULT_PUB_ALG

    public static final String DEFAULT_PUB_ALG

### pub_alg

    private String pub_alg

  the public-key algorithm-id.

### DEFAULT_KEY_LENGTH

    public static final int DEFAULT_KEY_LENGTH

### key_length

    private int key_length

  the key-length in bits.

### STATE_DEAD

    public static final int STATE_DEAD

### STATE_ALIVE

    public static final int STATE_ALIVE

### state

    private int state

### STATES

    public static final String[] STATES

### nonces

    private Vector nonces

### capability

    private Tag capability

Constructor Detail

### Monitor

    protected Monitor()

  Default constructor.

### Monitor

    public Monitor(PublicKey issuer,
                   Tag capability)
            throws SPKIException

  Create a brand new monitor, using the default algorithm, key-length and specified issuer. This constructor performs the following tasks:
  - generate and store the monitor's key-pair,
  - initialize all the databases used by the monitor.
  See Also:
    `Monitor(String,int,PublicKey,Tag)`

### Monitor

    public Monitor(String pub_alg,
                   int key_length,
                   PublicKey issuer,
                   Tag capability)
            throws SPKIException

  Create a brand new monitor, using the specified algorithm, key-length and issuer.
  See Also:
    `Monitor(PublicKey,Tag)`

### Monitor

    public Monitor(String db_id)
            throws SPKIException

  Restore a live monitor with the specified database id.
  See Also:
    `Monitor(PublicKey,Tag)`, `Monitor(String,int,PublicKey,Tag)`

Method Detail

### finalize

    protected void finalize()
                     throws Throwable

  Overrides:
    finalize in class Object

### getState

    public int getState()

  get the current state.
  See Also:
    `state`, `STATES`

### getDBId

    public String getDBId()

  get this monitor's id.

### getMasterKey

    public PublicKey getMasterKey()

  get this monitor's public key.

### getIssuer

    public PublicKey getIssuer()

  get this monitor's trusted issuer's public key.

### getCapability

    public Tag getCapability()

  get this monitor's accepted capability.

### newNonce

    public Sexp newNonce()
                  throws SPKIException

  generate a unique authorization nonce and save in the active nonce list.
  See Also:
    `nonces`

### authorize

    public Tag authorize(AuthorizationRequest request)
                  throws SPKIException

  verify the given authorization request and issue the authorization result.
  Returns:
    the authorized capability

### openDB

    private void openDB()
                 throws SPKIException

  to be used by construct() and restore() only!

### closeDB

    private void closeDB()
                  throws SPKIException

  to be used by the finalize() method only!

### buildDBname

    private String buildDBname(String dbname)
                        throws SPKIException

### construct

    private void construct()
                    throws Exception

### restore

    public void restore(String db_id)
                 throws Exception

  restore a monitor from the database with the given db-id.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD