pki
Class PKIDatabase

java.lang.Object
  |
  +--pki.PKIDatabase
All Implemented Interfaces:
java.lang.Runnable

public class PKIDatabase
extends java.lang.Object
implements java.lang.Runnable

This class manages the PKIs database.

Version:
$Id: PKIDatabase.java,v 1.14 2003/12/16 08:36:58 tk4 Exp $
Author:
Thomas Kriegelstein

Field Summary
protected  java.sql.Connection c
          The database connection object.
static int DB_FILE
           
static int DB_MYSQL
           
static boolean debug
           
 
Constructor Summary
PKIDatabase(java.util.Properties settings)
          Constructor for selecting the database type to use
 
Method Summary
 void addCertificate(java.math.BigInteger person, java.security.cert.X509Certificate cert)
          Inserts a pseudonym certificate into the database
 void addPersonCertificate(java.security.cert.X509Certificate cert)
          Inserts a person certificate into the database
 void addRoleCertificate(java.math.BigInteger person, java.security.cert.X509Certificate cert)
          Inserts a role certificate into the database
 java.security.cert.X509Certificate getCertificate(java.math.BigInteger serial)
          Returns a certificate for a pseudonym according to the given serial number
 java.math.BigInteger getLastSerial()
          Returns last (used) serial number
 java.math.BigInteger getNextSerialNumber()
          Returns the next free serial number, and stores it into database
 java.security.cert.X509Certificate getPersonCertificate(java.math.BigInteger serial)
          Returns a certificate for a person pseudonym according to the given serial number
 java.security.cert.X509Certificate getRoleCertificate(java.math.BigInteger serial)
          Returns a certificate for a role pseudonym according to the given serial number
 boolean initDB()
          Initializes a new database.
 boolean initDBFile()
          Initializes the file database.
 boolean initDBMysql()
          Initializes a MySQL database.
 boolean isConnected()
           
 boolean openDBFile()
          Opens a file database.
 boolean openDBMysql()
          Opens a MySQL database.
 void run()
           
 void setCertifier(pki.PKICert cert)
          Sets the certifier object to be used by this database instance.
 boolean start()
          Opens the database.
 void stop()
          Stops the database object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug

c

protected java.sql.Connection c
The database connection object.


DB_FILE

public static final int DB_FILE
See Also:
Constant Field Values

DB_MYSQL

public static final int DB_MYSQL
See Also:
Constant Field Values
Constructor Detail

PKIDatabase

public PKIDatabase(java.util.Properties settings)
Constructor for selecting the database type to use

Parameters:
settings - Settings for Database
Method Detail

isConnected

public boolean isConnected()

getNextSerialNumber

public java.math.BigInteger getNextSerialNumber()
Returns the next free serial number, and stores it into database


getLastSerial

public java.math.BigInteger getLastSerial()
Returns last (used) serial number


getPersonCertificate

public java.security.cert.X509Certificate getPersonCertificate(java.math.BigInteger serial)
Returns a certificate for a person pseudonym according to the given serial number


getRoleCertificate

public java.security.cert.X509Certificate getRoleCertificate(java.math.BigInteger serial)
Returns a certificate for a role pseudonym according to the given serial number


getCertificate

public java.security.cert.X509Certificate getCertificate(java.math.BigInteger serial)
Returns a certificate for a pseudonym according to the given serial number


addRoleCertificate

public void addRoleCertificate(java.math.BigInteger person,
                               java.security.cert.X509Certificate cert)
Inserts a role certificate into the database


addPersonCertificate

public void addPersonCertificate(java.security.cert.X509Certificate cert)
Inserts a person certificate into the database


addCertificate

public void addCertificate(java.math.BigInteger person,
                           java.security.cert.X509Certificate cert)
Inserts a pseudonym certificate into the database


setCertifier

public void setCertifier(pki.PKICert cert)
Sets the certifier object to be used by this database instance.


start

public boolean start()
Opens the database.


initDB

public boolean initDB()
Initializes a new database.


openDBFile

public boolean openDBFile()
Opens a file database.


initDBFile

public boolean initDBFile()
Initializes the file database.


openDBMysql

public boolean openDBMysql()
Opens a MySQL database.


initDBMysql

public boolean initDBMysql()
Initializes a MySQL database.


stop

public void stop()
Stops the database object.


run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2003 DRIM Team. All Rights Reserved.