public class RainbowSignatureTest
extends junit.framework.TestCase
| Modifier and Type | Field and Description |
|---|---|
protected java.security.KeyPairGenerator |
kpg |
protected java.security.Signature |
sig |
| Constructor and Description |
|---|
RainbowSignatureTest() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytesFromFile(java.io.File file) |
java.security.PrivateKey |
getPrivateKey(java.lang.String file) |
java.security.PublicKey |
getPublicKey(java.lang.String file) |
protected void |
performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
java.security.spec.AlgorithmParameterSpec kpgParams)
Test signature generation and verification
|
protected void |
performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
java.security.spec.AlgorithmParameterSpec kpgParams,
int messageSize)
Test signature generation and verification
|
protected void |
performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
int keySize)
Test signature generation and verification
|
protected void |
performSignVerifyTest(int numPassesSigVer,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey) |
protected void |
performVerifyTest(java.security.PublicKey pk,
byte[] signature,
byte[] message) |
void |
setUp() |
void |
test_KeyFactory() |
void |
testRainbowithSHA256() |
void |
testRainbowWithSHA224()
Using ParameterSpecs to initialize the key pair generator without initialization.
|
void |
testRainbowWithSHA384() |
void |
testRainbowWithSHA512() |
void |
testSignVerifyWithDefaultParams() |
void |
testSignVerifyWithRandomParams() |
void |
writeKey(java.lang.String file,
java.security.Key key) |
void |
writeToFile(java.lang.String filename,
java.lang.String data) |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toStringassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, failprotected java.security.KeyPairGenerator kpg
protected java.security.Signature sig
public void setUp()
setUp in class junit.framework.TestCaseprotected final void performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
java.security.spec.AlgorithmParameterSpec kpgParams)
throws java.lang.Exception
numPassesKPG - the number of key pair generation passesnumPassesSigVer - the number of sign/verify passeskpgParams - the parameters for the key pair generatorjava.lang.Exceptionprotected final void performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
java.security.spec.AlgorithmParameterSpec kpgParams,
int messageSize)
throws java.lang.Exception
numPassesKPG - the number of key pair generation passesnumPassesSigVer - the number of sign/verify passeskpgParams - the parameters for the key pair generatormessageSize - length of the messages which are signed in bytesjava.lang.Exceptionprotected final void performSignVerifyTest(int numPassesKPG,
int numPassesSigVer,
int keySize)
throws java.lang.Exception
numPassesKPG - the number of key pair generation passesnumPassesSigVer - the number of sign/verify passeskeySize - the key size for the key pair generatorjava.lang.Exceptionprotected final void performSignVerifyTest(int numPassesSigVer,
java.security.PublicKey pubKey,
java.security.PrivateKey privKey)
throws java.lang.Exception
java.lang.Exceptionprotected final void performVerifyTest(java.security.PublicKey pk,
byte[] signature,
byte[] message)
public void testRainbowWithSHA224()
throws java.lang.Exception
java.lang.Exceptionpublic void testRainbowithSHA256()
throws java.lang.Exception
java.lang.Exceptionpublic void testRainbowWithSHA384()
throws java.lang.Exception
java.lang.Exceptionpublic void testRainbowWithSHA512()
throws java.lang.Exception
java.lang.Exceptionpublic void test_KeyFactory()
throws java.lang.Exception
java.lang.Exceptionpublic java.security.PrivateKey getPrivateKey(java.lang.String file)
throws java.lang.Exception
java.lang.Exceptionpublic void writeToFile(java.lang.String filename,
java.lang.String data)
throws java.io.IOException
java.io.IOExceptionpublic void testSignVerifyWithRandomParams()
throws java.lang.Exception
java.lang.Exceptionpublic void testSignVerifyWithDefaultParams()
throws java.lang.Exception
java.lang.Exceptionpublic void writeKey(java.lang.String file,
java.security.Key key)
throws java.io.IOException
java.io.IOExceptionpublic java.security.PublicKey getPublicKey(java.lang.String file)
throws java.lang.Exception
java.lang.Exceptionpublic byte[] getBytesFromFile(java.io.File file)
throws java.io.IOException
java.io.IOException