Bouncy Castle Cryptography Library 1.48

org.bouncycastle.pqc.jcajce.provider.test
Class RainbowSignatureTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.bouncycastle.pqc.jcajce.provider.test.RainbowSignatureTest
All Implemented Interfaces:
junit.framework.Test

public class RainbowSignatureTest
extends junit.framework.TestCase


Field Summary
protected  java.security.KeyPairGenerator kpg
           
protected  java.security.Signature sig
           
 
Constructor Summary
RainbowSignatureTest()
           
 
Method Summary
 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)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, 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, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kpg

protected java.security.KeyPairGenerator kpg

sig

protected java.security.Signature sig
Constructor Detail

RainbowSignatureTest

public RainbowSignatureTest()
Method Detail

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

performSignVerifyTest

protected final void performSignVerifyTest(int numPassesKPG,
                                           int numPassesSigVer,
                                           java.security.spec.AlgorithmParameterSpec kpgParams)
                                    throws java.lang.Exception
Test signature generation and verification

Parameters:
numPassesKPG - the number of key pair generation passes
numPassesSigVer - the number of sign/verify passes
kpgParams - the parameters for the key pair generator
Throws:
java.lang.Exception

performSignVerifyTest

protected final void performSignVerifyTest(int numPassesKPG,
                                           int numPassesSigVer,
                                           java.security.spec.AlgorithmParameterSpec kpgParams,
                                           int messageSize)
                                    throws java.lang.Exception
Test signature generation and verification

Parameters:
numPassesKPG - the number of key pair generation passes
numPassesSigVer - the number of sign/verify passes
kpgParams - the parameters for the key pair generator
messageSize - length of the messages which are signed in bytes
Throws:
java.lang.Exception

performSignVerifyTest

protected final void performSignVerifyTest(int numPassesKPG,
                                           int numPassesSigVer,
                                           int keySize)
                                    throws java.lang.Exception
Test signature generation and verification

Parameters:
numPassesKPG - the number of key pair generation passes
numPassesSigVer - the number of sign/verify passes
keySize - the key size for the key pair generator
Throws:
java.lang.Exception

performSignVerifyTest

protected final void performSignVerifyTest(int numPassesSigVer,
                                           java.security.PublicKey pubKey,
                                           java.security.PrivateKey privKey)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

performVerifyTest

protected final void performVerifyTest(java.security.PublicKey pk,
                                       byte[] signature,
                                       byte[] message)

testRainbowWithSHA224

public void testRainbowWithSHA224()
                           throws java.lang.Exception
Using ParameterSpecs to initialize the key pair generator without initialization.

Throws:
java.lang.Exception

testRainbowithSHA256

public void testRainbowithSHA256()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testRainbowWithSHA384

public void testRainbowWithSHA384()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testRainbowWithSHA512

public void testRainbowWithSHA512()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_KeyFactory

public void test_KeyFactory()
                     throws java.lang.Exception
Throws:
java.lang.Exception

getPrivateKey

public java.security.PrivateKey getPrivateKey(java.lang.String file)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

writeToFile

public void writeToFile(java.lang.String filename,
                        java.lang.String data)
                 throws java.io.IOException
Throws:
java.io.IOException

testSignVerifyWithRandomParams

public void testSignVerifyWithRandomParams()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

testSignVerifyWithDefaultParams

public void testSignVerifyWithDefaultParams()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

writeKey

public void writeKey(java.lang.String file,
                     java.security.Key key)
              throws java.io.IOException
Throws:
java.io.IOException

getPublicKey

public java.security.PublicKey getPublicKey(java.lang.String file)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getBytesFromFile

public byte[] getBytesFromFile(java.io.File file)
                        throws java.io.IOException
Throws:
java.io.IOException

Bouncy Castle Cryptography Library 1.48