de.bb.security
Class SelfTest

java.lang.Object
  |
  +--de.bb.security.SelfTest

public class SelfTest
extends java.lang.Object

Provide self test function for all classes in this package ! NOT YET FINISHED !

Since:
$Date: 2005/04/30 12:05:15 $

Constructor Summary
SelfTest()
           
 
Method Summary
protected static byte[] calcMessageHash(java.security.MessageDigest md, int hlen, byte[] secret, long seqNum, int typ, byte[] b)
           
protected static byte[] calcMessageHash(MessageDigest md, int hlen, byte[] secret, long seqNum, int typ, byte[] b)
           
static boolean equals(byte[] a, byte[] b)
          Compares one byte array with another byte array
static boolean equals(byte[] a, int aOff, byte[] b, int bOff, int len)
          Compares one segment of a byte array with another segment if a byte array
static void main(java.lang.String[] args)
           
static boolean selftest()
          Run all defined tests for this package.
static boolean testDES()
          Run a test for DES
static boolean testDES2()
          Run a test for DES2
static boolean testDES3()
          Run a test for DES3
static boolean testMD5()
          Run a test for MD5
static boolean testRC2()
          Run a Test for RC2
static boolean testRMD160()
          Run a test for RipeMD160
static byte[] toHex(java.lang.String s)
           
static java.lang.String toString(byte[] b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelfTest

public SelfTest()
Method Detail

main

public static void main(java.lang.String[] args)

selftest

public static boolean selftest()
Run all defined tests for this package.
Returns:
true on success.

toHex

public static byte[] toHex(java.lang.String s)

toString

public static java.lang.String toString(byte[] b)

testDES

public static boolean testDES()
Run a test for DES
Returns:
true on success.

testDES2

public static boolean testDES2()
Run a test for DES2
Returns:
true on success.

testDES3

public static boolean testDES3()
Run a test for DES3
Returns:
true on success.

testRMD160

public static boolean testRMD160()
Run a test for RipeMD160

testMD5

public static boolean testMD5()
Run a test for MD5

calcMessageHash

protected static final byte[] calcMessageHash(java.security.MessageDigest md,
                                              int hlen,
                                              byte[] secret,
                                              long seqNum,
                                              int typ,
                                              byte[] b)
                                       throws java.lang.Exception

calcMessageHash

protected static final byte[] calcMessageHash(MessageDigest md,
                                              int hlen,
                                              byte[] secret,
                                              long seqNum,
                                              int typ,
                                              byte[] b)
                                       throws java.lang.Exception

testRC2

public static boolean testRC2()
Run a Test for RC2

equals

public static final boolean equals(byte[] a,
                                   int aOff,
                                   byte[] b,
                                   int bOff,
                                   int len)
Compares one segment of a byte array with another segment if a byte array
Parameters:
a - first byte array
aOff - offset into first byte array
b - second byte array
bOff - offset into second byte array
len - length of the compared segments
Returns:
true if the segments are equal, otherwise false

equals

public static final boolean equals(byte[] a,
                                   byte[] b)
Compares one byte array with another byte array
Parameters:
a - first byte array
b - second byte array
Returns:
true if the byte arrays are equal, otherwise false