Class Decoder

java.lang.Object
  |
  +--Decoder

public class Decoder
extends java.lang.Object

This class takes a BigInteger as encoded text and decodes it into an array of bytes.


Constructor Summary
Decoder(java.math.BigInteger d, java.math.BigInteger n)
          Constructs a new Decoder
 
Method Summary
 byte[] decode(java.math.BigInteger c)
          This takes a BigInteger representing an encoded value and decodes it into an array of bytes representing plain text
static void main(java.lang.String[] args)
          Tests the Decoder class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Decoder

public Decoder(java.math.BigInteger d,
               java.math.BigInteger n)
Constructs a new Decoder
Parameters:
d, - n These contain values for the decoding exponent and the modulus
Postcondition
A new Decoder has been created that contains the passed values.
Throws:
OutOfMemoryError - Indicates that there is insufficient memory for a new Decoder.
Method Detail

decode

public byte[] decode(java.math.BigInteger c)
This takes a BigInteger representing an encoded value and decodes it into an array of bytes representing plain text
Parameters:
c - This contains a BigInteger
Returns:
Returns an array of bytes containing the decoded data

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Tests the Decoder class
Parameters:
args[] - This parameter will be left empty
Postcondition
The BigInteger that represents the encoded value will be printed.
Throws:
OutOfMemoryError - Indicates that there is insufficient memory for a new Decoder, KeyGen, or array of bytes.