Class SerialNumber

  • All Implemented Interfaces:
    java.io.Serializable

    public class SerialNumber
    extends java.lang.Object
    implements java.io.Serializable
    This class defines the SerialNumber class used by certificates.
    Version:
    1.5
    Author:
    Amit Kapoor, Hemma Prafullchandra
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SerialNumber​(int num)
      The default constructor for this class using int.
      SerialNumber​(java.io.InputStream in)
      Create the object, decoding the values from the passed stream.
      SerialNumber​(java.math.BigInteger num)
      The default constructor for this class using BigInteger.
      SerialNumber​(BigInt num)  
      SerialNumber​(DerInputStream in)
      Create the object, decoding the values from the passed DER stream.
      SerialNumber​(DerValue val)
      Create the object, decoding the values from the passed DerValue.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void encode​(DerOutputStream out)
      Encode the SerialNumber in DER form to the stream.
      BigInt getNumber()
      Return the serial number.
      java.lang.String toString()
      Return the SerialNumber as user readable string.
      • Methods inherited from class java.lang.Object

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

      • SerialNumber

        public SerialNumber​(java.math.BigInteger num)
        The default constructor for this class using BigInteger.
        Parameters:
        num - the BigInteger number used to create the serial number.
      • SerialNumber

        public SerialNumber​(BigInt num)
      • SerialNumber

        public SerialNumber​(int num)
        The default constructor for this class using int.
        Parameters:
        num - the BigInteger number used to create the serial number.
      • SerialNumber

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

        public SerialNumber​(DerValue val)
                     throws java.io.IOException
        Create the object, decoding the values from the passed DerValue.
        Parameters:
        val - the DerValue to read the SerialNumber from.
        Throws:
        java.io.IOException - on decoding errors.
      • SerialNumber

        public SerialNumber​(java.io.InputStream in)
                     throws java.io.IOException
        Create the object, decoding the values from the passed stream.
        Parameters:
        in - the InputStream to read the SerialNumber from.
        Throws:
        java.io.IOException - on decoding errors.
    • Method Detail

      • toString

        public java.lang.String toString()
        Return the SerialNumber as user readable string.
        Overrides:
        toString in class java.lang.Object
      • encode

        public void encode​(DerOutputStream out)
                    throws java.io.IOException
        Encode the SerialNumber in DER form to the stream.
        Parameters:
        out - the DerOutputStream to marshal the contents to.
        Throws:
        java.io.IOException - on errors.
      • getNumber

        public BigInt getNumber()
        Return the serial number.