fi.hut.tcm.repository
Class LocalSPKIRepository

java.lang.Object
  |
  +--fi.hut.tcm.repository.CertificateRepository
        |
        +--fi.hut.tcm.repository.SPKICertificateRepository
              |
              +--fi.hut.tcm.repository.LocalSPKIRepository

class LocalSPKIRepository
extends SPKICertificateRepository

LocalSPKIRepository The LocalSPKIRepository uses a file to store the certificates.


Field Summary
private  CertTable byIssuer
          Indexes the certificates by issuer.
private  CertTable bySubject
          Indexes the certificates by subject.
private  java.lang.String fileName
          The name of the file where the certificates are stored on the disk.
private  boolean modified
          Indicates if the contents of this repository have been modified.
 
Fields inherited from class fi.hut.tcm.repository.SPKICertificateRepository
repository
 
Fields inherited from class fi.hut.tcm.repository.CertificateRepository
type
 
Constructor Summary
LocalSPKIRepository()
          Creates a new LocalSPKIRepository.
 
Method Summary
 void add(java.security.cert.Certificate cert)
          Adds the cert to the repository.
 void finalize()
          Saves the repository.
 java.util.Vector getCertsByIssuer(Issuer issuer)
          Returns all certificates that have been issued by the issuer.
 java.util.Vector getCertsBySubject(Subject subject)
          Returns all certificates that have been issued to the subject.
 void init()
          Initializes the repository.
 void load()
          Loads the CertTables from a file.
 void remove(java.security.cert.Certificate cert)
          Removes the cert from the repository.
 void save()
          Stores the CertTables to a file.
 
Methods inherited from class fi.hut.tcm.repository.SPKICertificateRepository
getCertsByIssuer, getCertsBySubject, getInstance
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

modified

private boolean modified
Indicates if the contents of this repository have been modified.

byIssuer

private CertTable byIssuer
Indexes the certificates by issuer.

bySubject

private CertTable bySubject
Indexes the certificates by subject.

fileName

private java.lang.String fileName
The name of the file where the certificates are stored on the disk.
Constructor Detail

LocalSPKIRepository

public LocalSPKIRepository()
Creates a new LocalSPKIRepository.
Method Detail

init

public void init()
Initializes the repository.

add

public void add(java.security.cert.Certificate cert)
         throws SPKIException
Adds the cert to the repository.
Overrides:
add in class CertificateRepository

remove

public void remove(java.security.cert.Certificate cert)
            throws java.lang.Exception
Removes the cert from the repository.
Overrides:
remove in class CertificateRepository

getCertsByIssuer

public java.util.Vector getCertsByIssuer(Issuer issuer)
Returns all certificates that have been issued by the issuer.
Overrides:
getCertsByIssuer in class SPKICertificateRepository

getCertsBySubject

public java.util.Vector getCertsBySubject(Subject subject)
Returns all certificates that have been issued to the subject.
Overrides:
getCertsBySubject in class SPKICertificateRepository

finalize

public void finalize()
Saves the repository.
Overrides:
finalize in class java.lang.Object

load

public void load()
          throws java.io.OptionalDataException,
                 java.lang.ClassNotFoundException,
                 java.io.StreamCorruptedException,
                 java.io.FileNotFoundException,
                 java.io.IOException
Loads the CertTables from a file.
Overrides:
load in class CertificateRepository

save

public void save()
          throws java.io.IOException
Stores the CertTables to a file.
Overrides:
save in class CertificateRepository