Class CertRecord

  • All Implemented Interfaces:
    IAttrSet, com.netscape.certsrv.dbs.certdb.ICertRecord, com.netscape.certsrv.dbs.IDBObj, java.io.Serializable

    public class CertRecord
    extends java.lang.Object
    implements com.netscape.certsrv.dbs.IDBObj, com.netscape.certsrv.dbs.certdb.ICertRecord
    A class represents a serializable certificate record.

    Version:
    $Revision$, $Date$
    Author:
    thomask
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger logger  
      protected static java.util.Vector<java.lang.String> mNames  
      • Fields inherited from interface com.netscape.certsrv.dbs.certdb.ICertRecord

        ATTR_AUTO_RENEW, ATTR_CERT_STATUS, ATTR_CREATE_TIME, ATTR_ID, ATTR_ISSUED_BY, ATTR_META_INFO, ATTR_MODIFY_TIME, ATTR_REVO_INFO, ATTR_REVOKED_BY, ATTR_REVOKED_ON, ATTR_X509CERT, ATTR_X509CERT_ALGORITHM, ATTR_X509CERT_DURATION, ATTR_X509CERT_EXTENSION, ATTR_X509CERT_ISSUER, ATTR_X509CERT_NOT_AFTER, ATTR_X509CERT_NOT_BEFORE, ATTR_X509CERT_PUBLIC_KEY_DATA, ATTR_X509CERT_SERIAL_NUMBER, ATTR_X509CERT_SIGNING_ALGORITHM, ATTR_X509CERT_SUBJECT, ATTR_X509CERT_VERSION, AUTO_RENEWAL_DISABLED, AUTO_RENEWAL_DONE, AUTO_RENEWAL_ENABLED, AUTO_RENEWAL_NOTIFIED, META_CERT_TYPE, META_CHALLENGE_PHRASE, META_CRMF_REQID, META_LDAPPUBLISH, META_OLD_CERT, META_PROFILE_ID, META_RENEWED_CERT, META_REQUEST_ID, META_REV_SHRTOK, STATUS_EXPIRED, STATUS_INVALID, STATUS_REVOKED, STATUS_REVOKED_EXPIRED, STATUS_VALID, X509CERT_ALGORITHM, X509CERT_DURATION, X509CERT_EXTENSION, X509CERT_ISSUER, X509CERT_NOT_AFTER, X509CERT_NOT_BEFORE, X509CERT_PUBLIC_KEY_DATA, X509CERT_SERIAL_NUMBER, X509CERT_SIGNING_ALGORITHM, X509CERT_SUBJECT, X509CERT_VERSION
    • Constructor Summary

      Constructors 
      Constructor Description
      CertRecord()
      Constructs empty certificate record.
      CertRecord​(java.math.BigInteger id, java.security.cert.Certificate cert, MetaInfo meta)
      Constructs certiificate record with certificate and meta info.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String name)
      Deletes attribute from this record.
      java.lang.Object get​(java.lang.String name)
      Retrieves attributes from this record.
      java.lang.String getAutoRenew()
      Retrieves the auto renew mode.
      org.mozilla.jss.netscape.security.x509.X509CertImpl getCertificate()
      Retrieves X509 certificate.
      java.math.BigInteger getCertificateSerialNumber()
      Retrieves certificate serial number.
      java.util.Date getCreateTime()
      Retrieves time of creation of this certificate record.
      java.util.Enumeration<java.lang.String> getElements()
      Returns an enumeration of the names of the attributes existing within this AttrSet.
      java.lang.String getIssuedBy()
      Retrieves the person who issues this certificate.
      MetaInfo getMetaInfo()
      Retrieves meta information.
      java.util.Date getModifyTime()
      Retrieves time of modification of this certificate record.
      java.util.Date getNotAfter()
      Retrieves not after.
      java.util.Date getNotBefore()  
      java.util.Date getRevocationDate()
      Return revocation date.
      com.netscape.certsrv.dbs.certdb.IRevocationInfo getRevocationInfo()
      Retrieves revocation information.
      java.lang.String getRevokedBy()
      Retrieves the person who revokes this certificate.
      java.util.Date getRevokedOn()
      Retrieves the date which this record is revoked.
      org.mozilla.jss.netscape.security.x509.RevocationReason getRevReason()
      returns the revocation reason
      java.util.Enumeration<java.lang.String> getSerializableAttrNames()
      Returns a list of serializable attribute names.
      java.math.BigInteger getSerialNumber()
      Retrieves serial number of this record.
      java.lang.String getStatus()
      Retrieves certificate status.
      boolean isCertOnHold()
      is this cert on hold?
      void set​(java.lang.String name, java.lang.Object obj)
      Sets attribute to this record.
      java.lang.String toString()
      String representation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • mNames

        protected static java.util.Vector<java.lang.String> mNames
    • Constructor Detail

      • CertRecord

        public CertRecord()
        Constructs empty certificate record.
      • CertRecord

        public CertRecord​(java.math.BigInteger id,
                          java.security.cert.Certificate cert,
                          MetaInfo meta)
        Constructs certiificate record with certificate and meta info.
    • Method Detail

      • set

        public void set​(java.lang.String name,
                        java.lang.Object obj)
                 throws EBaseException
        Sets attribute to this record.
        Specified by:
        set in interface IAttrSet
        Parameters:
        name - the name of the attribute
        obj - the attribute object.
        Throws:
        EBaseException - on attribute handling errors.
      • get

        public java.lang.Object get​(java.lang.String name)
                             throws EBaseException
        Retrieves attributes from this record.
        Specified by:
        get in interface IAttrSet
        Parameters:
        name - the name of the attribute to return.
        Throws:
        EBaseException - on attribute handling errors.
      • delete

        public void delete​(java.lang.String name)
                    throws EBaseException
        Deletes attribute from this record.
        Specified by:
        delete in interface IAttrSet
        Parameters:
        name - the name of the attribute to delete.
        Throws:
        EBaseException - on attribute handling errors.
      • getElements

        public java.util.Enumeration<java.lang.String> getElements()
        Description copied from interface: IAttrSet
        Returns an enumeration of the names of the attributes existing within this AttrSet.
        Specified by:
        getElements in interface IAttrSet
        Returns:
        an enumeration of the attribute names.
      • getSerializableAttrNames

        public java.util.Enumeration<java.lang.String> getSerializableAttrNames()
        Description copied from interface: com.netscape.certsrv.dbs.IDBObj
        Returns a list of serializable attribute names. This method should return the attribute name even if there is no attribute value for the attribute.
        Specified by:
        getSerializableAttrNames in interface com.netscape.certsrv.dbs.IDBObj
        Returns:
        a list of serializable attribute names
      • getCertificate

        public org.mozilla.jss.netscape.security.x509.X509CertImpl getCertificate()
        Retrieves X509 certificate.
        Specified by:
        getCertificate in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        certificate
      • getMetaInfo

        public MetaInfo getMetaInfo()
        Retrieves meta information.
        Specified by:
        getMetaInfo in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        meta info
      • getStatus

        public java.lang.String getStatus()
        Retrieves certificate status.
        Specified by:
        getStatus in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        certificate status
      • getAutoRenew

        public java.lang.String getAutoRenew()
        Retrieves the auto renew mode.
      • getRevocationInfo

        public com.netscape.certsrv.dbs.certdb.IRevocationInfo getRevocationInfo()
        Retrieves revocation information.
        Specified by:
        getRevocationInfo in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        revocation info
      • getSerialNumber

        public java.math.BigInteger getSerialNumber()
        Retrieves serial number of this record. Usually, it is the same of the serial number of the associated certificate.
        Specified by:
        getSerialNumber in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        certificate serial number
      • getIssuedBy

        public java.lang.String getIssuedBy()
        Retrieves the person who issues this certificate.
        Specified by:
        getIssuedBy in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        name of which user issued this certificate
      • getRevokedBy

        public java.lang.String getRevokedBy()
        Retrieves the person who revokes this certificate.
        Specified by:
        getRevokedBy in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        name of who revoked this certificate
      • getRevokedOn

        public java.util.Date getRevokedOn()
        Retrieves the date which this record is revoked.
        Specified by:
        getRevokedOn in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        date when this certificate was revoked
      • getCertificateSerialNumber

        public java.math.BigInteger getCertificateSerialNumber()
        Retrieves certificate serial number.
        Specified by:
        getCertificateSerialNumber in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        certificate serial number
      • getNotAfter

        public java.util.Date getNotAfter()
        Retrieves not after.
      • getNotBefore

        public java.util.Date getNotBefore()
      • getRevocationDate

        public java.util.Date getRevocationDate()
                                         throws com.netscape.certsrv.dbs.EDBException
        Return revocation date.
        Throws:
        com.netscape.certsrv.dbs.EDBException
      • getCreateTime

        public java.util.Date getCreateTime()
        Description copied from interface: com.netscape.certsrv.dbs.certdb.ICertRecord
        Retrieves time of creation of this certificate record.
        Specified by:
        getCreateTime in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        time of creation of this certificate record
      • getModifyTime

        public java.util.Date getModifyTime()
        Description copied from interface: com.netscape.certsrv.dbs.certdb.ICertRecord
        Retrieves time of modification of this certificate record.
        Specified by:
        getModifyTime in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Returns:
        time of modification of this certificate record
      • getRevReason

        public org.mozilla.jss.netscape.security.x509.RevocationReason getRevReason()
                                                                             throws EBaseException,
                                                                                    org.mozilla.jss.netscape.security.x509.X509ExtensionException
        Description copied from interface: com.netscape.certsrv.dbs.certdb.ICertRecord
        returns the revocation reason
        Specified by:
        getRevReason in interface com.netscape.certsrv.dbs.certdb.ICertRecord
        Throws:
        EBaseException
        org.mozilla.jss.netscape.security.x509.X509ExtensionException
      • isCertOnHold

        public boolean isCertOnHold()
        Description copied from interface: com.netscape.certsrv.dbs.certdb.ICertRecord
        is this cert on hold?
        Specified by:
        isCertOnHold in interface com.netscape.certsrv.dbs.certdb.ICertRecord
      • toString

        public java.lang.String toString()
        String representation
        Overrides:
        toString in class java.lang.Object