Package com.netscape.cmscore.dbs
Class CertificateRepository
- java.lang.Object
-
- com.netscape.cmscore.dbs.Repository
-
- com.netscape.cmscore.dbs.CertificateRepository
-
- All Implemented Interfaces:
ICertificateRepository,IRepository
public class CertificateRepository extends Repository implements ICertificateRepository
A class represents a certificate repository. It stores all the issued certificate.- Version:
- $Revision$, $Date$
- Author:
- thomask, kanda
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringCERT_X509ATTRIBUTEcom.netscape.cmscore.dbs.CertStatusUpdateTaskcertStatusUpdateTaskstatic org.slf4j.Loggerloggercom.netscape.cmscore.dbs.RetrieveModificationsTaskretrieveModificationsTaskcom.netscape.cmscore.dbs.SerialNumberUpdateTaskserialNumberUpdateTask-
Fields inherited from class com.netscape.cmscore.dbs.Repository
mCounter, mEnableRandomSerialNumbers, mMaxSerialNo, mMinSerialNo
-
Fields inherited from interface com.netscape.certsrv.dbs.certdb.ICertificateRepository
ALL_CERTS, ALL_UNREVOKED_CERTS, ALL_VALID_CERTS
-
-
Constructor Summary
Constructors Constructor Description CertificateRepository(IDBSubsystem dbService, java.lang.String certRepoBaseDN, int increment, java.lang.String baseDN)Constructs a certificate repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCertificateRecord(ICertRecord record)Adds a certificate record to the repository.voidaddCRLIssuingPoint(java.lang.String id, ICRLIssuingPoint crlIssuingPoint)register CRL Issuing PointvoidaddRevokedCertRecord(CertRecord record)Used by the Clone Master (CLA) to add a revoked certificate record to the repository.booleancheckCertificateRecord(java.math.BigInteger serialNo)booleancontainsCertificate(java.math.BigInteger serialNo)Checks if the specified certificate is in the repository.ICertRecordcreateCertRecord(java.math.BigInteger id, java.security.cert.Certificate cert, MetaInfo meta)Creates certificate record.voiddeleteCertificateRecord(java.math.BigInteger serialNo)Deletes certificate record.java.util.Enumeration<org.mozilla.jss.netscape.security.x509.X509CertImpl>findCertificates(java.lang.String filter)Finds all certificates given a filter.java.util.Enumeration<ICertRecord>findCertRecords(java.lang.String filter)Finds a list of certificate records that satisifies the filter.ICertRecordListfindCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, int pageSize)Finds certificate records.ICertRecordListfindCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, boolean hardJumpTo, java.lang.String sortKey, int pageSize)ICertRecordListfindCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String sortKey, int pageSize)Finds a list of certificate records that satisifies the filter.ICertRecordListfindCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, java.lang.String sortKey, int pageSize)Finds a list of certificate records that satisifies the filter.ICertRecordListfindCertRecordsInListRawJumpto(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, java.lang.String sortKey, int pageSize)Finds a list of certificate records that satisifies the filter.java.util.Enumeration<java.lang.Object>findCertRecs(java.lang.String filter)Deprecated.replaced byfindCertificatesInListjava.util.Enumeration<java.lang.Object>findCertRecs(java.lang.String filter, java.lang.String[] attrs)java.util.Enumeration<ICertRecord>getAllExpiredCertificates()Retrives all expired certificates.java.util.Enumeration<ICertRecord>getAllExpiredPublishedCertificates()Retrives all expired publishedcertificates.java.util.Enumeration<ICertRecord>getAllRevokedCertificates()Retrives all revoked certificates including ones already expired or not yet valid.java.util.Enumeration<ICertRecord>getAllRevokedNonExpiredCertificates()Retrives all revoked certificates excluing ones already expired.java.util.Enumeration<ICertRecord>getAllRevokedPublishedCertificates()Retrives all revoked published certificates including ones already expired or not yet valid.java.util.Enumeration<ICertRecord>getAllValidCertificates()Retrives all valid certificates excluding ones already revoked.java.util.Enumeration<ICertRecord>getAllValidNotPublishedCertificates()Retrives all valid not published certificates excluding ones already revoked.IDBSubsystemgetDBSubsystem()Retrieves backend database handle.java.lang.StringgetDN()Retrieves DN of this repository.booleangetEnableRandomSerialNumbers()Retrieves serial number management mode.java.util.Enumeration<ICertRecord>getExpiredCertificates(java.lang.String from, java.lang.String to)Retrives all expired certificates.java.util.Enumeration<ICertRecord>getExpiredPublishedCertificates(java.lang.String from, java.lang.String to)Retrives all expired published certificates.ICertRecordListgetInvalidCertsByNotBeforeDate(java.util.Date date, int pageSize)Gets Invalid certs orderes by noAfter date, jumps to records where notAfter date is greater than current.java.math.BigIntegergetLastSerialNumberInRange(java.math.BigInteger serial_low_bound, java.math.BigInteger serial_upper_bound)voidgetModifications(netscape.ldap.LDAPEntry entry)Retrieves modified certificate records.java.math.BigIntegergetNextSerialNumber()Retrieves the next serial number, and also increase the serial number by one.java.util.Hashtable<java.lang.String,RenewableCertificateCollection>getRenewableCertificates(java.lang.String renewalTime)Retrieves renewable certificates.java.lang.StringgetRequestDN()java.util.Enumeration<ICertRecord>getRevokedCertificates(java.lang.String from, java.lang.String to)Retrieves all revoked certificates in the serial number range.java.util.Enumeration<ICertRecord>getRevokedCertificates(java.util.Date asOfDate)Retrieves all revoked certificates that have not expired.ICertRecordListgetRevokedCertsByNotAfterDate(java.util.Date date, int pageSize)Gets Revoked certs orderes by noAfter date, jumps to records where notAfter date is greater than current.java.util.Enumeration<ICertRecord>getRevokedPublishedCertificates(java.lang.String from, java.lang.String to)Retrieves all revoked publishedcertificates in the serial number range.java.util.Enumeration<ICertRecord>getValidCertificates(java.lang.String from, java.lang.String to)Retrives all valid certificates excluding ones already revoked.ICertRecordListgetValidCertsByNotAfterDate(java.util.Date date, int pageSize)Gets valid certs orderes by noAfter date, jumps to records where notAfter date is greater than current.java.util.Enumeration<ICertRecord>getValidNotPublishedCertificates(java.lang.String from, java.lang.String to)Retrives all valid not published certificates excluding ones already revoked.org.mozilla.jss.netscape.security.x509.X509CertImplgetX509Certificate(java.math.BigInteger serialNo)Reads the certificate identified by the given serial no.org.mozilla.jss.netscape.security.x509.X509CertImpl[]getX509Certificates(java.lang.String filter)org.mozilla.jss.netscape.security.x509.X509CertImpl[]getX509Certificates(java.lang.String subjectDN, int validityType)Gets all valid and unexpired certificates pertaining to a subject DN.RevocationInfoisCertificateRevoked(org.mozilla.jss.netscape.security.x509.X509CertImpl cert)Checks if the presented certificate belongs to the repository and is revoked.voidmarkAsRevoked(java.math.BigInteger id, IRevocationInfo info)Marks certificate as revoked.voidmarkAsRevoked(java.math.BigInteger id, IRevocationInfo info, boolean isAlreadyRevoked)Marks certificate as revoked.voidmarkCertificateAsNotRenewable(ICertRecord record)Marks certificate as renewable.voidmarkCertificateAsRenewable(ICertRecord record)Marks certificate as renewable.voidmarkCertificateAsRenewalNotified(java.lang.String serialNo)Marks certificate as renewed and notified.voidmarkCertificateAsRenewed(java.lang.String serialNo)Marks certificate as renewed.voidmodifyCertificateRecord(java.math.BigInteger serialNo, ModificationSet mods)Modifies certificate record.ICertRecordreadCertificateRecord(java.math.BigInteger serialNo)Reads certificate from repository.voidremoveCertRecords(java.math.BigInteger beginS, java.math.BigInteger endS)Removes all objects with this repository.java.util.Enumeration<java.lang.Object>searchCertificates(java.lang.String filter, int maxSize)Finds a list of certificate records that satisifies the filter.java.util.Enumeration<ICertRecord>searchCertificates(java.lang.String filter, int maxSize, int timeLimit)Finds a list of certificate records that satisifies the filter.java.util.Enumeration<ICertRecord>searchCertificates(java.lang.String filter, int maxSize, int timeLimit, java.lang.String sortAttribute)Finds a list of certificate records that satisifies the filter.java.util.Enumeration<java.lang.Object>searchCertificates(java.lang.String filter, int maxSize, java.lang.String sortAttribute)Finds a list of certificate records that satisifies the filter.voidsetCertStatusUpdateInterval(IRepository requestRepository, int interval, boolean listenToCloneModifications)interval value: (in seconds) 0 - disable >0 - enablevoidsetConsistencyCheck(boolean ConsistencyCheck)voidsetEnableRandomSerialNumbers(boolean random, boolean updateMode, boolean forceModeChange)Sets serial number management mode for certificates..voidsetRequestDN(java.lang.String requestDN)voidsetSerialNumberUpdateInterval(IRepository requestRepository, int interval)interval value: (in seconds) 0 - disable >0 - enablevoidsetSkipIfInConsistent(boolean SkipIfInconsistent)voidsetTransitMaxRecords(int max)voidsetTransitRecordPageSize(int size)voidshutdown()voidtransitInvalidCertificates()This transits a certificate status from INVALID to VALID if a certificate becomes valid.voidtransitRevokedExpiredCertificates()This transits a certificate status from REVOKED to REVOKED_EXPIRED if an revoked certificate becomes expired.voidtransitValidCertificates()This transits a certificate status from VALID to EXPIRED if a certificate becomes expired.voidunmarkRevoked(java.math.BigInteger id, IRevocationInfo info, java.util.Date revokedOn, java.lang.String revokedBy)Unmarks revoked certificate.voidupdateCertStatus()Updates certificate status now.voidupdateCounter()voidupdateStatus(java.math.BigInteger id, java.lang.String status)Updates the certificiate record status to the specified.-
Methods inherited from class com.netscape.cmscore.dbs.Repository
checkRange, checkRanges, getMaxSerial, getMinSerial, getNextMaxSerial, getSerialNumber, initCacheIfNeeded, peekNextSerialNumber, resetSerialNumber, setEnableSerialMgmt, setLastSerialNo, setMaxSerial, setNextMaxSerial, setSerialNumber, setTheSerialNumber
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netscape.certsrv.dbs.repository.IRepository
checkRanges, peekNextSerialNumber, resetSerialNumber, setEnableSerialMgmt, setMaxSerial, setNextMaxSerial
-
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
CERT_X509ATTRIBUTE
public final java.lang.String CERT_X509ATTRIBUTE
- See Also:
- Constant Field Values
-
certStatusUpdateTask
public com.netscape.cmscore.dbs.CertStatusUpdateTask certStatusUpdateTask
-
retrieveModificationsTask
public com.netscape.cmscore.dbs.RetrieveModificationsTask retrieveModificationsTask
-
serialNumberUpdateTask
public com.netscape.cmscore.dbs.SerialNumberUpdateTask serialNumberUpdateTask
-
-
Constructor Detail
-
CertificateRepository
public CertificateRepository(IDBSubsystem dbService, java.lang.String certRepoBaseDN, int increment, java.lang.String baseDN) throws EDBException
Constructs a certificate repository.- Throws:
EDBException
-
-
Method Detail
-
createCertRecord
public ICertRecord createCertRecord(java.math.BigInteger id, java.security.cert.Certificate cert, MetaInfo meta)
Description copied from interface:ICertificateRepositoryCreates certificate record.- Specified by:
createCertRecordin interfaceICertificateRepository- Parameters:
id- serial numbercert- certificatemeta- meta information- Returns:
- certificate record
-
getEnableRandomSerialNumbers
public boolean getEnableRandomSerialNumbers()
Description copied from interface:ICertificateRepositoryRetrieves serial number management mode.- Specified by:
getEnableRandomSerialNumbersin interfaceICertificateRepository- Returns:
- serial number management mode, "true" indicates random serial number management, "false" indicates sequential serial number management.
-
setEnableRandomSerialNumbers
public void setEnableRandomSerialNumbers(boolean random, boolean updateMode, boolean forceModeChange)Description copied from interface:ICertificateRepositorySets serial number management mode for certificates..- Specified by:
setEnableRandomSerialNumbersin interfaceICertificateRepository- Parameters:
random- "true" sets random serial number management, "false" sequentialupdateMode- "true" updates "description" attribute in certificate repositoryforceModeChange- "true" forces certificate repository mode change
-
getNextSerialNumber
public java.math.BigInteger getNextSerialNumber() throws EBaseExceptionDescription copied from class:RepositoryRetrieves the next serial number, and also increase the serial number by one.- Specified by:
getNextSerialNumberin interfaceICertificateRepository- Specified by:
getNextSerialNumberin interfaceIRepository- Overrides:
getNextSerialNumberin classRepository- Returns:
- serial number
- Throws:
EBaseException- failed to retrieve next serial number
-
updateCounter
public void updateCounter()
-
getLastSerialNumberInRange
public java.math.BigInteger getLastSerialNumberInRange(java.math.BigInteger serial_low_bound, java.math.BigInteger serial_upper_bound) throws EBaseException- Specified by:
getLastSerialNumberInRangein classRepository- Throws:
EBaseException
-
removeCertRecords
public void removeCertRecords(java.math.BigInteger beginS, java.math.BigInteger endS) throws EBaseExceptionRemoves all objects with this repository.- Specified by:
removeCertRecordsin interfaceICertificateRepository- Parameters:
beginS- BigInteger with radix 16endS- BigInteger with radix 16- Throws:
EBaseException
-
setConsistencyCheck
public void setConsistencyCheck(boolean ConsistencyCheck)
-
setSkipIfInConsistent
public void setSkipIfInConsistent(boolean SkipIfInconsistent)
-
setTransitMaxRecords
public void setTransitMaxRecords(int max)
-
setTransitRecordPageSize
public void setTransitRecordPageSize(int size)
-
addCRLIssuingPoint
public void addCRLIssuingPoint(java.lang.String id, ICRLIssuingPoint crlIssuingPoint)register CRL Issuing Point
-
setCertStatusUpdateInterval
public void setCertStatusUpdateInterval(IRepository requestRepository, int interval, boolean listenToCloneModifications)
interval value: (in seconds) 0 - disable >0 - enable- Specified by:
setCertStatusUpdateIntervalin interfaceICertificateRepository- Parameters:
requestRepository- request repositoryinterval- update intervallistenToCloneModifications- enable listening to clone modifications
-
setSerialNumberUpdateInterval
public void setSerialNumberUpdateInterval(IRepository requestRepository, int interval)
interval value: (in seconds) 0 - disable >0 - enable
-
updateCertStatus
public void updateCertStatus() throws EBaseExceptionDescription copied from interface:ICertificateRepositoryUpdates certificate status now. This is a blocking method.- Specified by:
updateCertStatusin interfaceICertificateRepository- Throws:
EBaseException- failed to update
-
getDN
public java.lang.String getDN()
Retrieves DN of this repository.
-
setRequestDN
public void setRequestDN(java.lang.String requestDN)
-
getRequestDN
public java.lang.String getRequestDN()
-
getDBSubsystem
public IDBSubsystem getDBSubsystem()
Retrieves backend database handle.
-
addCertificateRecord
public void addCertificateRecord(ICertRecord record) throws EBaseException
Adds a certificate record to the repository. Each certificate record contains four parts: certificate, meta-attributes, issue information and reovcation information.- Specified by:
addCertificateRecordin interfaceICertificateRepository- Parameters:
cert- X.509 certificate- Throws:
EBaseException- failed to add new certificate to the repository
-
addRevokedCertRecord
public void addRevokedCertRecord(CertRecord record) throws EBaseException
Used by the Clone Master (CLA) to add a revoked certificate record to the repository.- Parameters:
record- a CertRecord- Throws:
EBaseException- failed to add new certificate to the repository
-
transitValidCertificates
public void transitValidCertificates() throws EBaseExceptionThis transits a certificate status from VALID to EXPIRED if a certificate becomes expired.- Throws:
EBaseException
-
transitRevokedExpiredCertificates
public void transitRevokedExpiredCertificates() throws EBaseExceptionThis transits a certificate status from REVOKED to REVOKED_EXPIRED if an revoked certificate becomes expired.- Throws:
EBaseException
-
transitInvalidCertificates
public void transitInvalidCertificates() throws EBaseExceptionThis transits a certificate status from INVALID to VALID if a certificate becomes valid.- Throws:
EBaseException
-
getX509Certificate
public org.mozilla.jss.netscape.security.x509.X509CertImpl getX509Certificate(java.math.BigInteger serialNo) throws EBaseExceptionReads the certificate identified by the given serial no.- Specified by:
getX509Certificatein interfaceICertificateRepository- Parameters:
serialNo- serial number of certificate- Returns:
- certificate
- Throws:
EBaseException- failed to retrieve certificate
-
deleteCertificateRecord
public void deleteCertificateRecord(java.math.BigInteger serialNo) throws EBaseExceptionDeletes certificate record.- Specified by:
deleteCertificateRecordin interfaceICertificateRepository- Parameters:
serialNo- serial number of certificate- Throws:
EBaseException- failed to delete
-
readCertificateRecord
public ICertRecord readCertificateRecord(java.math.BigInteger serialNo) throws EBaseException
Reads certificate from repository.- Specified by:
readCertificateRecordin interfaceICertificateRepository- Parameters:
serialNo- serial number of certificate- Returns:
- certificate record
- Throws:
EBaseException- failed to retrieve certificate
-
checkCertificateRecord
public boolean checkCertificateRecord(java.math.BigInteger serialNo) throws EBaseException- Throws:
EBaseException
-
modifyCertificateRecord
public void modifyCertificateRecord(java.math.BigInteger serialNo, ModificationSet mods) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryModifies certificate record.- Specified by:
modifyCertificateRecordin interfaceICertificateRepository- Parameters:
serialNo- serial number of recordmods- modifications- Throws:
EBaseException- failed to modify
-
containsCertificate
public boolean containsCertificate(java.math.BigInteger serialNo) throws EBaseExceptionChecks if the specified certificate is in the repository.- Specified by:
containsCertificatein interfaceICertificateRepository- Parameters:
serialNo- serial number of certificate- Returns:
- true if it exists
- Throws:
EBaseException- failed to check
-
markAsRevoked
public void markAsRevoked(java.math.BigInteger id, IRevocationInfo info) throws EBaseExceptionMarks certificate as revoked. isAlreadyRevoked - boolean to indicate that the cert was revoked ( possibly onHold ) When a cert was originally revoked (possibly onHold), some of the ldap attributes already exist, so "MOD_REPLACE" is needed instead of "MOD_ADD"- Specified by:
markAsRevokedin interfaceICertificateRepository- Parameters:
id- serial numberinfo- revocation information- Throws:
EBaseException- failed to mark
-
markAsRevoked
public void markAsRevoked(java.math.BigInteger id, IRevocationInfo info, boolean isAlreadyRevoked) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryMarks certificate as revoked.- Specified by:
markAsRevokedin interfaceICertificateRepository- Parameters:
id- serial numberinfo- revocation informationisAlreadyRevoked- boolean to indicate if the cert was revoked onHold- Throws:
EBaseException- failed to mark
-
unmarkRevoked
public void unmarkRevoked(java.math.BigInteger id, IRevocationInfo info, java.util.Date revokedOn, java.lang.String revokedBy) throws EBaseExceptionUnmarks revoked certificate.- Specified by:
unmarkRevokedin interfaceICertificateRepository- Parameters:
id- serial numberinfo- revocation informationrevokedOn- revocation daterevokedBy- userid- Throws:
EBaseException- failed to unmark
-
updateStatus
public void updateStatus(java.math.BigInteger id, java.lang.String status) throws EBaseExceptionUpdates the certificiate record status to the specified.- Specified by:
updateStatusin interfaceICertificateRepository- Parameters:
id- serial numberstatus- certificate status- Throws:
EBaseException- failed to update status
-
searchCertificates
public java.util.Enumeration<java.lang.Object> searchCertificates(java.lang.String filter, int maxSize, java.lang.String sortAttribute) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
searchCertificatesin interfaceICertificateRepository- Parameters:
filter- search filtermaxSize- max size to returnsortAttribute- Attribute of ICertRecord to sort the results- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
searchCertificates
public java.util.Enumeration<java.lang.Object> searchCertificates(java.lang.String filter, int maxSize) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter. Here is a list of filter attribute can be used:certRecordId certMetaInfo certStatus certCreateTime certModifyTime x509Cert.notBefore x509Cert.notAfter x509Cert.subject
The filter should follow RFC1558 LDAP filter syntax. For example,(&(certRecordId=5)(x509Cert.notBefore=934398398))
- Specified by:
searchCertificatesin interfaceICertificateRepository- Parameters:
filter- search filtermaxSize- max size to return- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
searchCertificates
public java.util.Enumeration<ICertRecord> searchCertificates(java.lang.String filter, int maxSize, int timeLimit) throws EBaseException
Description copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
searchCertificatesin interfaceICertificateRepository- Parameters:
filter- search filtermaxSize- max size to returntimeLimit- timeout value- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
searchCertificates
public java.util.Enumeration<ICertRecord> searchCertificates(java.lang.String filter, int maxSize, int timeLimit, java.lang.String sortAttribute) throws EBaseException
Description copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
searchCertificatesin interfaceICertificateRepository- Parameters:
filter- search filtermaxSize- max size to returntimeLimit- timeout valuesortAttribute- Attribute of ICertRecord to sort the results- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecs
public java.util.Enumeration<java.lang.Object> findCertRecs(java.lang.String filter) throws EBaseExceptionDeprecated.replaced byfindCertificatesInListReturns a list of X509CertImp that satisfies the filter.- Specified by:
findCertRecsin interfaceICertificateRepository- Parameters:
filter- search filter- Returns:
- a list of certificate records
- Throws:
EBaseException- failed to retrieve cert records
-
findCertRecs
public java.util.Enumeration<java.lang.Object> findCertRecs(java.lang.String filter, java.lang.String[] attrs) throws EBaseException- Throws:
EBaseException
-
findCertificates
public java.util.Enumeration<org.mozilla.jss.netscape.security.x509.X509CertImpl> findCertificates(java.lang.String filter) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryFinds all certificates given a filter.- Specified by:
findCertificatesin interfaceICertificateRepository- Parameters:
filter- search filter- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecords
public java.util.Enumeration<ICertRecord> findCertRecords(java.lang.String filter) throws EBaseException
Finds a list of certificate records that satisifies the filter. If you are going to process everything in the list, use this.- Specified by:
findCertRecordsin interfaceICertificateRepository- Parameters:
filter- search filter- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecordsInList
public ICertRecordList findCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, int pageSize) throws EBaseException
Finds certificate records. Here is a list of filter attribute can be used:certRecordId certMetaInfo certStatus certCreateTime certModifyTime x509Cert.notBefore x509Cert.notAfter x509Cert.subject
The filter should follow RFC1558 LDAP filter syntax. For example,(&(certRecordId=5)(x509Cert.notBefore=934398398))
- Specified by:
findCertRecordsInListin interfaceICertificateRepository- Parameters:
filter- search filterattrs- selected attributepageSize- page size- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecordsInList
public ICertRecordList findCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String sortKey, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
findCertRecordsInListin interfaceICertificateRepository- Parameters:
filter- search filterattrs- selected attributesortKey- key to use for sorting the returned elementspageSize- page size- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecordsInList
public ICertRecordList findCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, java.lang.String sortKey, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
findCertRecordsInListin interfaceICertificateRepository- Parameters:
filter- search filterattrs- selected attributejumpTo- jump to indexsortKey- key to use for sorting the returned elementspageSize- page size- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
findCertRecordsInList
public ICertRecordList findCertRecordsInList(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, boolean hardJumpTo, java.lang.String sortKey, int pageSize) throws EBaseException
- Specified by:
findCertRecordsInListin interfaceICertificateRepository- Throws:
EBaseException
-
findCertRecordsInListRawJumpto
public ICertRecordList findCertRecordsInListRawJumpto(java.lang.String filter, java.lang.String[] attrs, java.lang.String jumpTo, java.lang.String sortKey, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryFinds a list of certificate records that satisifies the filter.- Specified by:
findCertRecordsInListRawJumptoin interfaceICertificateRepository- Parameters:
filter- search filterattrs- selected attributejumpTo- jump to indexsortKey- key to use for sorting the returned elementspageSize- page size- Returns:
- a list of certificates
- Throws:
EBaseException- failed to search
-
markCertificateAsRenewable
public void markCertificateAsRenewable(ICertRecord record) throws EBaseException
Marks certificate as renewable.- Specified by:
markCertificateAsRenewablein interfaceICertificateRepository- Parameters:
record- certificate record to modify- Throws:
EBaseException- failed to update
-
markCertificateAsNotRenewable
public void markCertificateAsNotRenewable(ICertRecord record) throws EBaseException
Marks certificate as renewable.- Specified by:
markCertificateAsNotRenewablein interfaceICertificateRepository- Parameters:
record- certificate record to modify- Throws:
EBaseException- failed to update
-
markCertificateAsRenewed
public void markCertificateAsRenewed(java.lang.String serialNo) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryMarks certificate as renewed.- Specified by:
markCertificateAsRenewedin interfaceICertificateRepository- Parameters:
serialNo- certificate record to modify- Throws:
EBaseException- failed to update
-
markCertificateAsRenewalNotified
public void markCertificateAsRenewalNotified(java.lang.String serialNo) throws EBaseExceptionDescription copied from interface:ICertificateRepositoryMarks certificate as renewed and notified.- Specified by:
markCertificateAsRenewalNotifiedin interfaceICertificateRepository- Parameters:
serialNo- certificate record to modify- Throws:
EBaseException- failed to update
-
getRenewableCertificates
public java.util.Hashtable<java.lang.String,RenewableCertificateCollection> getRenewableCertificates(java.lang.String renewalTime) throws EBaseException
Description copied from interface:ICertificateRepositoryRetrieves renewable certificates.- Specified by:
getRenewableCertificatesin interfaceICertificateRepository- Parameters:
renewalTime- renewal time- Returns:
- certificates
- Throws:
EBaseException- failed to retrieve
-
getX509Certificates
public org.mozilla.jss.netscape.security.x509.X509CertImpl[] getX509Certificates(java.lang.String subjectDN, int validityType) throws EBaseExceptionGets all valid and unexpired certificates pertaining to a subject DN.- Specified by:
getX509Certificatesin interfaceICertificateRepository- Parameters:
subjectDN- The distinguished name of the subject.validityType- The type of certificates to get.- Returns:
- An array of certificates.
- Throws:
EBaseException- on error.
-
getX509Certificates
public org.mozilla.jss.netscape.security.x509.X509CertImpl[] getX509Certificates(java.lang.String filter) throws EBaseException- Throws:
EBaseException
-
getValidCertificates
public java.util.Enumeration<ICertRecord> getValidCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrives all valid certificates excluding ones already revoked.- Specified by:
getValidCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllValidCertificates
public java.util.Enumeration<ICertRecord> getAllValidCertificates() throws EBaseException
Retrives all valid certificates excluding ones already revoked.- Throws:
EBaseException
-
getValidNotPublishedCertificates
public java.util.Enumeration<ICertRecord> getValidNotPublishedCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrives all valid not published certificates excluding ones already revoked.- Specified by:
getValidNotPublishedCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllValidNotPublishedCertificates
public java.util.Enumeration<ICertRecord> getAllValidNotPublishedCertificates() throws EBaseException
Retrives all valid not published certificates excluding ones already revoked.- Throws:
EBaseException
-
getExpiredCertificates
public java.util.Enumeration<ICertRecord> getExpiredCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrives all expired certificates.- Specified by:
getExpiredCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllExpiredCertificates
public java.util.Enumeration<ICertRecord> getAllExpiredCertificates() throws EBaseException
Retrives all expired certificates.- Throws:
EBaseException
-
getExpiredPublishedCertificates
public java.util.Enumeration<ICertRecord> getExpiredPublishedCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrives all expired published certificates.- Specified by:
getExpiredPublishedCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllExpiredPublishedCertificates
public java.util.Enumeration<ICertRecord> getAllExpiredPublishedCertificates() throws EBaseException
Retrives all expired publishedcertificates.- Throws:
EBaseException
-
getInvalidCertsByNotBeforeDate
public ICertRecordList getInvalidCertsByNotBeforeDate(java.util.Date date, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryGets Invalid certs orderes by noAfter date, jumps to records where notAfter date is greater than current.- Specified by:
getInvalidCertsByNotBeforeDatein interfaceICertificateRepository- Parameters:
date- reference datepageSize- page size- Returns:
- a list of certificate records
- Throws:
EBaseException- failed to retrieve
-
getValidCertsByNotAfterDate
public ICertRecordList getValidCertsByNotAfterDate(java.util.Date date, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryGets valid certs orderes by noAfter date, jumps to records where notAfter date is greater than current.- Specified by:
getValidCertsByNotAfterDatein interfaceICertificateRepository- Parameters:
date- reference datepageSize- page size- Returns:
- a list of certificate records
- Throws:
EBaseException- failed to retrieve
-
getRevokedCertsByNotAfterDate
public ICertRecordList getRevokedCertsByNotAfterDate(java.util.Date date, int pageSize) throws EBaseException
Description copied from interface:ICertificateRepositoryGets Revoked certs orderes by noAfter date, jumps to records where notAfter date is greater than current.- Specified by:
getRevokedCertsByNotAfterDatein interfaceICertificateRepository- Parameters:
date- reference datepageSize- page size- Returns:
- a list of certificate records
- Throws:
EBaseException- failed to retrieve
-
getRevokedCertificates
public java.util.Enumeration<ICertRecord> getRevokedCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrieves all revoked certificates in the serial number range.- Specified by:
getRevokedCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllRevokedCertificates
public java.util.Enumeration<ICertRecord> getAllRevokedCertificates() throws EBaseException
Retrives all revoked certificates including ones already expired or not yet valid.- Specified by:
getAllRevokedCertificatesin interfaceICertificateRepository- Returns:
- a list of revoked certificates
- Throws:
EBaseException- failed to search
-
getRevokedPublishedCertificates
public java.util.Enumeration<ICertRecord> getRevokedPublishedCertificates(java.lang.String from, java.lang.String to) throws EBaseException
Retrieves all revoked publishedcertificates in the serial number range.- Specified by:
getRevokedPublishedCertificatesin interfaceICertificateRepository- Parameters:
from- The starting point of the serial number range.to- The ending point of the serial number range.- Returns:
- a list of certificates
- Throws:
EBaseException- failed to retrieve
-
getAllRevokedPublishedCertificates
public java.util.Enumeration<ICertRecord> getAllRevokedPublishedCertificates() throws EBaseException
Retrives all revoked published certificates including ones already expired or not yet valid.- Throws:
EBaseException
-
getRevokedCertificates
public java.util.Enumeration<ICertRecord> getRevokedCertificates(java.util.Date asOfDate) throws EBaseException
Retrieves all revoked certificates that have not expired.- Specified by:
getRevokedCertificatesin interfaceICertificateRepository- Parameters:
asOfDate- as of date- Returns:
- a list of revoked certificates
- Throws:
EBaseException- failed to retrieve
-
getAllRevokedNonExpiredCertificates
public java.util.Enumeration<ICertRecord> getAllRevokedNonExpiredCertificates() throws EBaseException
Retrives all revoked certificates excluing ones already expired.- Specified by:
getAllRevokedNonExpiredCertificatesin interfaceICertificateRepository- Returns:
- a list of revoked certificates
- Throws:
EBaseException- failed to search
-
getModifications
public void getModifications(netscape.ldap.LDAPEntry entry)
Description copied from interface:ICertificateRepositoryRetrieves modified certificate records.- Specified by:
getModificationsin interfaceICertificateRepository- Parameters:
entry- LDAPEntry with modified data
-
isCertificateRevoked
public RevocationInfo isCertificateRevoked(org.mozilla.jss.netscape.security.x509.X509CertImpl cert) throws EBaseException
Checks if the presented certificate belongs to the repository and is revoked.- Parameters:
cert- certificate to verify.- Returns:
- RevocationInfo if the presented certificate is revoked otherwise null.
- Throws:
EBaseException
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceICertificateRepository
-
-