Class FreshestCRLExtension

java.lang.Object
org.mozilla.jss.netscape.security.x509.Extension
org.mozilla.jss.netscape.security.x509.FreshestCRLExtension
All Implemented Interfaces:
Serializable, CertAttrSet

public class FreshestCRLExtension extends Extension implements CertAttrSet
An extension that tells applications where to find the latest (freshest) delta CRL for this certificate or full CRL.
 cRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint

 DistributionPoint ::= SEQUENCE {
      distributionPoint       [0]     DistributionPointName OPTIONAL,
      reasons                 [1]     ReasonFlags OPTIONAL,
      cRLIssuer               [2]     GeneralNames OPTIONAL }

 DistributionPointName ::= CHOICE {
      fullName                [0]     GeneralNames,
      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }

 ReasonFlags ::= BIT STRING {
      unused                  (0),
      keyCompromise           (1),
      cACompromise            (2),
      affiliationChanged      (3),
      superseded              (4),
      cessationOfOperation    (5),
      certificateHold         (6) }
 
See Also:
  • Field Details

  • Constructor Details

    • FreshestCRLExtension

      public FreshestCRLExtension()
    • FreshestCRLExtension

      public FreshestCRLExtension(Boolean critical, Object value)
      This constructor is called by the CertificateExtensions class to decode an extension whose OID indicates it is a CRLDistributionsPoints extension.
    • FreshestCRLExtension

      public FreshestCRLExtension(CRLDistributionPoint dp)
      Creates a new FreshestCRL extension, with the given distribution point as the first element.
  • Method Details

    • addPoint

      public void addPoint(CRLDistributionPoint dp)
      Adds an additional distribution point to the end of the sequence.
    • getNumPoints

      public int getNumPoints()
      Returns the number of distribution points in the sequence.
    • getPointAt

      public CRLDistributionPoint getPointAt(int index)
      Returns the DistributionPoint at the given index in the sequence.
    • setCritical

      public void setCritical(boolean critical)
      Sets the criticality of this extension. PKIX dictates that this extension SHOULD NOT be critical, so applications can make it critical if they have a very good reason. By default, the extension is not critical.
      Overrides:
      setCritical in class Extension
    • encode

      public void encode(DerOutputStream out) throws IOException
      Encodes this extension to the given DerOutputStream. This method re-encodes each time it is called, so it is not very efficient.
      Overrides:
      encode in class Extension
      Parameters:
      out - the DerOutputStream to write the extension to.
      Throws:
      IOException - on encoding errors
    • flushCachedEncoding

      public void flushCachedEncoding()
      Should be called if any change is made to this data structure so that the cached DER encoding can be discarded.
    • toString

      public String toString()
      Description copied from class: Extension
      Returns the Extension in user readable form.
      Specified by:
      toString in interface CertAttrSet
      Overrides:
      toString in class Extension
      Returns:
      value of this certificate attribute in printable form.
    • encode

      public void encode(OutputStream ostream) throws CertificateException, IOException
      DER-encodes this extension to the given OutputStream.
      Specified by:
      encode in interface CertAttrSet
      Parameters:
      ostream - the OutputStream to encode the attribute to.
      Throws:
      CertificateException - on encoding or validity errors.
      IOException - on other errors.
    • decode

      public void decode(InputStream in) throws CertificateException, IOException
      Description copied from interface: CertAttrSet
      Decodes the attribute in the input stream.
      Specified by:
      decode in interface CertAttrSet
      Parameters:
      in - the InputStream to read the encoded attribute from.
      Throws:
      CertificateException - on decoding or validity errors.
      IOException - on other errors.
    • set

      public void set(String name, Object obj) throws CertificateException, IOException
      Description copied from interface: CertAttrSet
      Sets an attribute value within this CertAttrSet.
      Specified by:
      set in interface CertAttrSet
      Parameters:
      name - the name of the attribute (e.g. "x509.info.key")
      obj - the attribute object.
      Throws:
      CertificateException - on attribute handling errors.
      IOException - on other errors.
    • get

      public Object get(String name) throws CertificateException, IOException
      Description copied from interface: CertAttrSet
      Gets an attribute value for this CertAttrSet.
      Specified by:
      get in interface CertAttrSet
      Parameters:
      name - the name of the attribute to return.
      Returns:
      attribute value
      Throws:
      CertificateException - on attribute handling errors.
      IOException - on other errors.
    • delete

      public void delete(String name) throws CertificateException, IOException
      Description copied from interface: CertAttrSet
      Deletes an attribute value from this CertAttrSet.
      Specified by:
      delete in interface CertAttrSet
      Parameters:
      name - the name of the attribute to delete.
      Throws:
      CertificateException - on attribute handling errors.
      IOException - on other errors.
    • getAttributeNames

      public Enumeration<String> getAttributeNames()
      Description copied from interface: CertAttrSet
      Returns an enumeration of the names of the attributes existing within this attribute.
      Specified by:
      getAttributeNames in interface CertAttrSet
      Returns:
      an enumeration of the attribute names.
    • getName

      public String getName()
      Description copied from interface: CertAttrSet
      Returns the name (identifier) of this CertAttrSet.
      Specified by:
      getName in interface CertAttrSet
      Returns:
      the name of this CertAttrSet.
    • main

      public static void main(String[] args)
      Test driver.