spki.demo
Class RootIssuer

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

public class RootIssuer
extends Object

spki.demo RootIssuer class.

Version:
$Id: RootIssuer.java,v 1.1 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  HashDB cert_db
          the live master certificates database object.
private static String CERT_DBNAME
          the certificates database filename suffix.
private  PublicKey certifier
          the certifier's principal.
private static String CERTIFIER_DBKEY
          the certifier's database index key.
private  String db_id
           
private static String DBPATH
          databases's pathname prefix.
static int DEFAULT_KEY_LENGTH
           
static String DEFAULT_PUB_ALG
           
private  HashDB escrow_db
          the escrow database object.
private static String ESCROW_DBNAME
          the escrow database filename suffix.
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 issuer's key-pair's database index key.
private  Vector nonces
          list of active registration request 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 issuer's public key.
private  int state
           
static int STATE_ALIVE
           
static int STATE_DEAD
           
static String[] STATES
           
 
Constructor Summary
protected RootIssuer()
          Default constructor.
  RootIssuer(PublicKey certifier)
          Create a brand new issuer, using the default algorithm, key-length and specified certifier.
  RootIssuer(String db_id)
          Restore a live issuer with the specified database id.
  RootIssuer(String pub_alg, int key_length, PublicKey certifier)
          Create a brand new issuer, using the specified algorithm, key-length and certifier.
 
Method Summary
private  String buildDBname(String dbname)
           
private  void closeDB()
          to be used by the finalize() method only!
private  void construct()
           
protected  void finalize()
           
 PublicKey getCertifier()
          get this issuer's trusted certifier's public key.
 String getDBId()
          get this issuer's database id.
 PublicKey getMasterKey()
          get this issuer's public key.
 int getState()
          get the current state.
 Sexp newNonce()
          generate a unique registration nonce and store in the active nonce list.
private  void openDB()
          to be used by construct() and restore() only!
 Certificate register(RegistrationRequest request)
          verify the given RegistrationRequest and issue a capability certificate with the requested capability.
 void restore(String db_id)
          restore the RootIssuer object 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.

CERT_DBNAME

private static final String CERT_DBNAME
the certificates database filename suffix.

cert_db

private HashDB cert_db
the live master certificates database object.

db_id

private String db_id

ESCROW_DBNAME

private static final String ESCROW_DBNAME
the escrow database filename suffix.

escrow_db

private HashDB escrow_db
the escrow database object.

MASTER_KEYPAIR_DBKEY

private static final String MASTER_KEYPAIR_DBKEY
the issuer'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 issuer'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.

CERTIFIER_DBKEY

private static final String CERTIFIER_DBKEY
the certifier's database index key.

certifier

private PublicKey certifier
the certifier'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
list of active registration request nonces.
See Also:
newNonce(), register(RegistrationRequest)
Constructor Detail

RootIssuer

protected RootIssuer()
Default constructor.

RootIssuer

public RootIssuer(PublicKey certifier)
           throws SPKIException
Create a brand new issuer, using the default algorithm, key-length and specified certifier. This constructor performs the following tasks:
  • generate and store the issuer's key-pair,
  • initialize all the databases used by the issuer.
    See Also:
    RootIssuer(String,int,PublicKey)

  • RootIssuer

    public RootIssuer(String pub_alg,
                      int key_length,
                      PublicKey certifier)
               throws SPKIException
    Create a brand new issuer, using the specified algorithm, key-length and certifier.
    See Also:
    RootIssuer(PublicKey)

    RootIssuer

    public RootIssuer(String db_id)
               throws SPKIException
    Restore a live issuer with the specified database id.
    See Also:
    RootIssuer(PublicKey), RootIssuer(String,int,PublicKey)
    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 issuer's database id.

    getMasterKey

    public PublicKey getMasterKey()
    get this issuer's public key.

    getCertifier

    public PublicKey getCertifier()
    get this issuer's trusted certifier's public key.

    newNonce

    public Sexp newNonce()
                  throws SPKIException
    generate a unique registration nonce and store in the active nonce list.
    See Also:
    nonces

    register

    public Certificate register(RegistrationRequest request)
                         throws SPKIException
    verify the given RegistrationRequest and issue a capability certificate with the requested capability.
    See Also:
    RegistrationRequest

    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 the RootIssuer object from the database with the given db-id.