Class CertificateVersion

java.lang.Object
org.mozilla.jss.netscape.security.x509.CertificateVersion
All Implemented Interfaces:
CertAttrSet

public class CertificateVersion extends Object implements CertAttrSet
This class defines the version of the X509 Certificate.
Version:
1.8
See Also:
  • Field Details

  • Constructor Details

    • CertificateVersion

      public CertificateVersion()
      The default constructor for this class, sets the version to 0 (i.e. X.509 version 1).
    • CertificateVersion

      public CertificateVersion(int version) throws IOException
      The constructor for this class for the required version.
      Parameters:
      version - the version for the certificate.
      Throws:
      IOException - if the version is not valid.
    • CertificateVersion

      public CertificateVersion(DerInputStream in) throws IOException
      Create the object, decoding the values from the passed DER stream.
      Parameters:
      in - the DerInputStream to read the CertificateVersion from.
      Throws:
      IOException - on decoding errors.
    • CertificateVersion

      public CertificateVersion(InputStream in) throws IOException
      Create the object, decoding the values from the passed stream.
      Parameters:
      in - the InputStream to read the CertificateVersion from.
      Throws:
      IOException - on decoding errors.
    • CertificateVersion

      public CertificateVersion(DerValue val) throws IOException
      Create the object, decoding the values from the passed DerValue.
      Parameters:
      val - the Der encoded value.
      Throws:
      IOException - on decoding errors.
  • Method Details

    • getVersion

      private int getVersion()
    • construct

      private void construct(DerValue derVal) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Return the version number of the certificate.
      Specified by:
      toString in interface CertAttrSet
      Overrides:
      toString in class Object
      Returns:
      value of this certificate attribute in printable form.
    • encode

      public void encode(OutputStream out) throws IOException
      Encode the CertificateVersion period in DER form to the stream.
      Specified by:
      encode in interface CertAttrSet
      Parameters:
      out - the OutputStream to marshal the contents to.
      Throws:
      IOException - on errors.
    • decode

      public void decode(InputStream in) throws IOException
      Decode the CertificateVersion period in DER form from the stream.
      Specified by:
      decode in interface CertAttrSet
      Parameters:
      in - the InputStream to unmarshal the contents from.
      Throws:
      IOException - on errors.
    • set

      public void set(String name, Object obj) throws IOException
      Set the attribute value.
      Specified by:
      set in interface CertAttrSet
      Parameters:
      name - the name of the attribute (e.g. "x509.info.key")
      obj - the attribute object.
      Throws:
      IOException - on other errors.
    • get

      public Object get(String name) throws IOException
      Get the attribute value.
      Specified by:
      get in interface CertAttrSet
      Parameters:
      name - the name of the attribute to return.
      Returns:
      attribute value
      Throws:
      IOException - on other errors.
    • delete

      public void delete(String name) throws IOException
      Delete the attribute value.
      Specified by:
      delete in interface CertAttrSet
      Parameters:
      name - the name of the attribute to delete.
      Throws:
      IOException - on other errors.
    • getAttributeNames

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

      public String getName()
      Return the name of this attribute.
      Specified by:
      getName in interface CertAttrSet
      Returns:
      the name of this CertAttrSet.
    • compare

      public int compare(int vers)
      Compare versions.