All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.dsig.CertDatabase

java.lang.Object
   |
   +----w3c.www.dsig.CertDatabase

public final class CertDatabase
extends Object
This class implements a simple database of identity certificates mapping names to certificates. It can be used to retrieve all available certificates for an individual with a given name. Certificates follow the standard java.security.Certificate API.

This class cannot be instantiated, all of its methods are static. Extension mechanisms that allow to replace the simple base class by one that indeed queries a database are yet to be designed.


Method Index

 o addCert(Certificate)
Add a certificate to the database.
 o certForName(Principal)
Return all certificates for the named individual.
 o certForName(Principal, int)
Return the certificate at position index for the given individual.
 o certForName(String)
Return all certificates for the named individual.
 o certForName(String, int)
Return the certificate at position index for the given individual.
 o certificates()
Return an Enumeration of the names of all individuals in the database.
 o printDatabase()
Print the names of each individual in the database and the number certificate each of them has.
 o removeCert(Certificate)
Remove a certificate from the database.
 o removeCert(Principal, int)
Removes the certificate at position index for the invidual name from the database.
 o removeCert(String, int)
Removes the certificate at position index for the invidual name from the database.
 o reset()
Reset the database.

Methods

 o reset
 public static void reset()
Reset the database. It will contain no certificates after this method is invoked. Mainly for debugging purposes.

 o printDatabase
 public static void printDatabase()
Print the names of each individual in the database and the number certificate each of them has.

 o addCert
 public static boolean addCert(Certificate cert)
Add a certificate to the database. Return true if the certificate was successfully added or false otherwise (i.e. it was already present).

 o removeCert
 public static void removeCert(String name,
                               int index) throws ArrayIndexOutOfBoundsException
Removes the certificate at position index for the invidual name from the database.

Throws: ArrayIndexOutOfBoundsException
if the specified certficate does not exist.
 o removeCert
 public static void removeCert(Principal pr,
                               int index) throws ArrayIndexOutOfBoundsException
Removes the certificate at position index for the invidual name from the database. Shorthand for removeCert(pr.getName(), index);

Throws: ArrayIndexOutOfBoundsException
if the specified certficate does not exist.
 o removeCert
 public static boolean removeCert(Certificate cert)
Remove a certificate from the database. Return true if it is was successfully removed, false otherwise (i.e. certificate was not present in the database).

 o certificates
 public static Enumeration certificates()
Return an Enumeration of the names of all individuals in the database.

 o certForName
 public static Certificate[] certForName(String name)
Return all certificates for the named individual. If no certificates are available, this returns an array of size 0.

 o certForName
 public static Certificate[] certForName(Principal pr)
Return all certificates for the named individual. Shorthand for certForName(pr.getName())

 o certForName
 public static Certificate certForName(String name,
                                       int index) throws ArrayIndexOutOfBoundsException
Return the certificate at position index for the given individual.

Throws: ArrayIndexOutOfBoundsException
if the given index is not valid.
 o certForName
 public static Certificate certForName(Principal pr,
                                       int index) throws ArrayIndexOutOfBoundsException
Return the certificate at position index for the given individual. Shorthand for certForName(pr.getName(), index).

Throws: ArrayIndexOutOfBoundsException
if the given index is not valid.

All Packages  Class Hierarchy  This Package  Previous  Next  Index