Class CertificateSubjectName

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

public class CertificateSubjectName extends Object implements CertAttrSet, Serializable
This class defines the X500Name attribute for the Certificate.
Version:
1.6
See Also:
  • Field Details

  • Constructor Details

    • CertificateSubjectName

      public CertificateSubjectName(X500Name name)
      Default constructor for the certificate attribute.
      Parameters:
      name - the X500Name
    • CertificateSubjectName

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

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

    • toString

      public String toString()
      Return the name as user readable string.
      Specified by:
      toString in interface CertAttrSet
      Overrides:
      toString in class Object
      Returns:
      value of this certificate attribute in printable form.
    • writeObject

      private void writeObject(ObjectOutputStream stream) throws IOException
      Throws:
      IOException
    • readObject

      private void readObject(ObjectInputStream stream) throws IOException
      Throws:
      IOException
    • encode

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

      public void decodeEx(InputStream in) throws IOException
      Decode the name in DER form from the stream.
      Parameters:
      in - the InputStream to marshal the contents from.
      Throws:
      IOException - on errors.
    • decode

      public void decode(InputStream in) throws IOException
      Decode the name in DER form from the stream.
      Specified by:
      decode in interface CertAttrSet
      Parameters:
      in - the InputStream to marshal 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.
    • getX500Name

      public X500Name getX500Name()
      Get underlying X500Name value. Where the type is known to be CertificateSubjectName, use this method instead of 'get' to avoid casts and exceptions.
    • 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.