com.netscape.certsrv.dbs.keydb
Interface IKeyRepository

All Superinterfaces:
IRepository

public interface IKeyRepository
extends IRepository

An interface represents a Key repository. This is the container of archived keys.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Method Summary
 void addKeyRecord(IKeyRecord record)
          Archives a key to the repository.
 void deleteKeyRecord(java.math.BigInteger serialno)
          Deletes a key record.
 IKeyRecordList findKeyRecordsInList(java.lang.String filter, java.lang.String[] attrs, int pageSize)
          Searchs for a list of key records.
 IKeyRecordList findKeyRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String sortKey, int pageSize)
          Searchs for a list of key records.
 void modifyKeyRecord(java.math.BigInteger serialNo, ModificationSet mods)
          Modifies key record in this repository.
 IKeyRecord readKeyRecord(java.math.BigInteger serialNo)
          Reads an archived key by serial number.
 IKeyRecord readKeyRecord(java.security.PublicKey publicKey)
          Reads archived key using public key.
 IKeyRecord readKeyRecord(java.lang.String cert)
          Reads an archived key by b64 encoded cert.
 IKeyRecord readKeyRecord(netscape.security.x509.X500Name ownerName)
          Reads an archived key by owner name.
 java.util.Enumeration searchKeys(java.lang.String filter, int maxSize)
          Searches for private keys.
 java.util.Enumeration searchKeys(java.lang.String filter, int maxSize, int timeLimt)
          Searches for private keys.
 
Methods inherited from interface com.netscape.certsrv.dbs.repository.IRepository
checkRanges, getNextSerialNumber, getTheSerialNumber, resetSerialNumber, setEnableSerialMgmt, setMaxSerial, setNextMaxSerial
 

Method Detail

addKeyRecord

void addKeyRecord(IKeyRecord record)
                  throws EBaseException
Archives a key to the repository.

Parameters:
record - key record
Throws:
EBaseException - failed to archive key

readKeyRecord

IKeyRecord readKeyRecord(java.math.BigInteger serialNo)
                         throws EBaseException
Reads an archived key by serial number.

Parameters:
serialNo - serial number
Returns:
key record
Throws:
EBaseException - failed to recover key

readKeyRecord

IKeyRecord readKeyRecord(java.lang.String cert)
                         throws EBaseException
Reads an archived key by b64 encoded cert.

Parameters:
cert - b64 encoded cert
Returns:
key record
Throws:
EBaseException - failed to recover key

readKeyRecord

IKeyRecord readKeyRecord(netscape.security.x509.X500Name ownerName)
                         throws EBaseException
Reads an archived key by owner name.

Parameters:
ownerName - owner name
Returns:
key record
Throws:
EBaseException - failed to recover key

readKeyRecord

IKeyRecord readKeyRecord(java.security.PublicKey publicKey)
                         throws EBaseException
Reads archived key using public key.

Parameters:
publicKey - public key that is corresponding to the private key
Returns:
key record
Throws:
EBaseException - failed to read key

searchKeys

java.util.Enumeration searchKeys(java.lang.String filter,
                                 int maxSize)
                                 throws EBaseException
Searches for private keys.

Parameters:
filter - LDAP filter for the search
maxSize - maximium number of entries to be returned
Returns:
a list of private key records
Throws:
EBaseException - failed to search keys

searchKeys

java.util.Enumeration searchKeys(java.lang.String filter,
                                 int maxSize,
                                 int timeLimt)
                                 throws EBaseException
Searches for private keys.

Parameters:
filter - LDAP filter for the search
maxSize - maximium number of entries to be returned
timeLimt - timeout value
Returns:
a list of private key records
Throws:
EBaseException - failed to search keys

deleteKeyRecord

void deleteKeyRecord(java.math.BigInteger serialno)
                     throws EBaseException
Deletes a key record.

Parameters:
serialno - key identifier
Throws:
EBaseException - failed to delete key record

modifyKeyRecord

void modifyKeyRecord(java.math.BigInteger serialNo,
                     ModificationSet mods)
                     throws EBaseException
Modifies key record in this repository.

Parameters:
serialNo - key identifier
mods - modification of key records
Throws:
EBaseException - failed to modify key record

findKeyRecordsInList

IKeyRecordList findKeyRecordsInList(java.lang.String filter,
                                    java.lang.String[] attrs,
                                    int pageSize)
                                    throws EBaseException
Searchs for a list of key records. Here is a list of supported filter attributes:
   keySerialNumber
   keyState
   algorithm
   keySize
   keyOwnerName
   privateKey
   publicKey
   dateOfRecovery
   keyCreateTime
   keyModifyTime
   keyMetaInfo
 

Parameters:
filter - search filter
attrs - list of attributes to be returned
pageSize - virtual list page size
Returns:
list of key records
Throws:
EBaseException - failed to search key records

findKeyRecordsInList

IKeyRecordList findKeyRecordsInList(java.lang.String filter,
                                    java.lang.String[] attrs,
                                    java.lang.String sortKey,
                                    int pageSize)
                                    throws EBaseException
Searchs for a list of key records.

Parameters:
filter - search filter
attrs - list of attributes to be returned
sortKey - name of attribute that the list should be sorted by
pageSize - virtual list page size
Returns:
list of key records
Throws:
EBaseException - failed to search key records