org.bouncycastle.jce.provider.test
Class PBETest

java.lang.Object
  extended by org.bouncycastle.util.test.SimpleTest
      extended by org.bouncycastle.jce.provider.test.PBETest
All Implemented Interfaces:
Test

public class PBETest
extends SimpleTest

test out the various PBE modes, making sure the JCE implementations are compatible woth the light weight ones.


Nested Class Summary
private  class PBETest.OpenSSLTest
           
private  class PBETest.PKCS12Test
           
 
Field Summary
private  byte[] hMac1
           
private  byte[] hMac2
           
(package private) static byte[] message
           
private  PBETest.OpenSSLTest[] openSSLTests
           
private  PBETest.PKCS12Test[] pkcs12Tests
           
 
Constructor Summary
PBETest()
           
 
Method Summary
private  boolean arrayEquals(byte[] a, byte[] b)
           
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
private  javax.crypto.Cipher makePBECipherUsingParam(java.lang.String algorithm, int mode, char[] password, byte[] salt, int iterationCount)
           
private  javax.crypto.Cipher makePBECipherWithoutParam(java.lang.String algorithm, int mode, char[] password, byte[] salt, int iterationCount)
           
 void performTest()
           
 void testPBEHMac(java.lang.String hmacName, byte[] output)
           
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, fail, fail, fail, perform, runTest, runTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pkcs12Tests

private PBETest.PKCS12Test[] pkcs12Tests

openSSLTests

private PBETest.OpenSSLTest[] openSSLTests

message

static byte[] message

hMac1

private byte[] hMac1

hMac2

private byte[] hMac2
Constructor Detail

PBETest

public PBETest()
Method Detail

makePBECipherUsingParam

private javax.crypto.Cipher makePBECipherUsingParam(java.lang.String algorithm,
                                                    int mode,
                                                    char[] password,
                                                    byte[] salt,
                                                    int iterationCount)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

makePBECipherWithoutParam

private javax.crypto.Cipher makePBECipherWithoutParam(java.lang.String algorithm,
                                                      int mode,
                                                      char[] password,
                                                      byte[] salt,
                                                      int iterationCount)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

arrayEquals

private boolean arrayEquals(byte[] a,
                            byte[] b)

testPBEHMac

public void testPBEHMac(java.lang.String hmacName,
                        byte[] output)

performTest

public void performTest()
                 throws java.lang.Exception
Specified by:
performTest in class SimpleTest
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Specified by:
getName in interface Test
Specified by:
getName in class SimpleTest

main

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