com.ibm.security12.sun.security.x509
Class SerialNumber

java.lang.Object
  |
  +--com.ibm.security12.sun.security.x509.SerialNumber

public class SerialNumber
extends Object

This class defines the SerialNumber class used by certificates.

Version:
1.6
Author:
Amit Kapoor, Hemma Prafullchandra

Constructor Summary
SerialNumber(java.math.BigInteger num)
          The default constructor for this class using BigInteger.
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.
SerialNumber(InputStream in)
          Create the object, decoding the values from the passed stream.
SerialNumber(int num)
          The default constructor for this class using int.
 
Method Summary
 void encode(DerOutputStream out)
          Encode the SerialNumber in DER form to the stream.
 BigInt getNumber()
          Return the serial number.
 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(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 IOException
Create the object, decoding the values from the passed DER stream.
Parameters:
in - the DerInputStream to read the SerialNumber from.
Throws:
IOException - on decoding errors.

SerialNumber

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

SerialNumber

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

toString

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

encode

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

getNumber

public BigInt getNumber()
Return the serial number.