|
From: <pe...@us...> - 2003-11-21 04:43:46
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/test/org/neuclear/commons/crypto/signers
Modified Files:
SimpleSignerStoreTest.java TestCaseSignerTest.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: SimpleSignerStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/SimpleSignerStoreTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleSignerStoreTest.java 19 Nov 2003 23:32:51 -0000 1.3
--- SimpleSignerStoreTest.java 21 Nov 2003 04:43:42 -0000 1.4
***************
*** 1,4 ****
--- 1,10 ----
/* $Id$
* $Log$
+ * Revision 1.4 2003/11/21 04:43:42 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.3 2003/11/19 23:32:51 pelle
* Signers now can generatekeys via the generateKey() method.
***************
*** 106,111 ****
* @version $Revision$
*/
! public class SimpleSignerStoreTest extends TestCase {
! public SimpleSignerStoreTest(String name) throws GeneralSecurityException, NeuClearException, ConfigurationException {
super(name);
signer = getSignerStoreInstance();
--- 112,117 ----
* @version $Revision$
*/
! public final class SimpleSignerStoreTest extends TestCase {
! public SimpleSignerStoreTest(final String name) throws GeneralSecurityException, NeuClearException, ConfigurationException {
super(name);
signer = getSignerStoreInstance();
***************
*** 136,140 ****
! public void testAddKey() throws NeuClearException, GeneralSecurityException, IOException {
boolean success = false;
try {
--- 142,146 ----
! public final void testAddKey() throws NeuClearException, GeneralSecurityException, IOException {
boolean success = false;
try {
***************
*** 149,153 ****
}
! public void testSignData() throws NeuClearException, GeneralSecurityException, IOException, CryptoException {
boolean success = false;
byte data[] = null;
--- 155,159 ----
}
! public final void testSignData() throws NeuClearException, GeneralSecurityException, IOException, CryptoException {
boolean success = false;
byte data[] = null;
***************
*** 167,174 ****
}
! public void testGenerateKey() throws CryptoException {
! PublicKey pub = signer.generateKey("tupac");
! byte data[] = "this is a test".getBytes();
! byte sig[] = signer.sign("tupac", data);
assertNotNull(sig);
assertTrue(CryptoTools.verify(pub, data, sig));
--- 173,180 ----
}
! public final void testGenerateKey() throws CryptoException {
! final PublicKey pub = signer.generateKey("tupac");
! final byte[] data = "this is a test".getBytes();
! final byte[] sig = signer.sign("tupac", data);
assertNotNull(sig);
assertTrue(CryptoTools.verify(pub, data, sig));
***************
*** 178,182 ****
}
! private SimpleSigner signer;
private static KeyPairGenerator kg;
protected static KeyPair root;
--- 184,188 ----
}
! private final SimpleSigner signer;
private static KeyPairGenerator kg;
protected static KeyPair root;
Index: TestCaseSignerTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/TestCaseSignerTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestCaseSignerTest.java 19 Nov 2003 23:32:51 -0000 1.2
--- TestCaseSignerTest.java 21 Nov 2003 04:43:42 -0000 1.3
***************
*** 29,32 ****
--- 29,38 ----
$Id$
$Log$
+ Revision 1.3 2003/11/21 04:43:42 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.2 2003/11/19 23:32:51 pelle
Signers now can generatekeys via the generateKey() method.
***************
*** 49,59 ****
* Time: 2:48:23 PM
*/
! public class TestCaseSignerTest extends TestCase {
! public TestCaseSignerTest(String string) throws GeneralSecurityException, NeuClearException {
super(string);
signer = new TestCaseSigner();
}
! public void testHasKeys() throws CryptoException {
assertTrue(signer.canSignFor("neu://test"));
assertTrue(signer.canSignFor("neu://test/bux"));
--- 55,65 ----
* Time: 2:48:23 PM
*/
! public final class TestCaseSignerTest extends TestCase {
! public TestCaseSignerTest(final String string) throws GeneralSecurityException, NeuClearException {
super(string);
signer = new TestCaseSigner();
}
! public final void testHasKeys() throws CryptoException {
assertTrue(signer.canSignFor("neu://test"));
assertTrue(signer.canSignFor("neu://test/bux"));
***************
*** 62,66 ****
}
! public void testSignAndVerify() throws CryptoException {
testKey("neu://test");
testKey("neu://test/bux");
--- 68,72 ----
}
! public final void testSignAndVerify() throws CryptoException {
testKey("neu://test");
testKey("neu://test/bux");
***************
*** 69,76 ****
}
! public void testGenerateKey() throws CryptoException {
! PublicKey pub = signer.generateKey(ALIASEVE);
! byte data[] = "this is a test".getBytes();
! byte sig[] = signer.sign(ALIASEVE, data);
assertNotNull(sig);
assertTrue(CryptoTools.verify(pub, data, sig));
--- 75,82 ----
}
! public final void testGenerateKey() throws CryptoException {
! final PublicKey pub = signer.generateKey(ALIASEVE);
! final byte[] data = "this is a test".getBytes();
! final byte[] sig = signer.sign(ALIASEVE, data);
assertNotNull(sig);
assertTrue(CryptoTools.verify(pub, data, sig));
***************
*** 80,85 ****
}
! private void testKey(String name) throws CryptoException {
! byte sig[] = signer.sign(name, TESTDATA.getBytes());
assertNotNull(sig);
assertTrue(CryptoTools.verify(signer.getPublicKey(name), TESTDATA.getBytes(), sig));
--- 86,91 ----
}
! private void testKey(final String name) throws CryptoException {
! final byte[] sig = signer.sign(name, TESTDATA.getBytes());
assertNotNull(sig);
assertTrue(CryptoTools.verify(signer.getPublicKey(name), TESTDATA.getBytes(), sig));
***************
*** 87,92 ****
! private TestCaseSigner signer;
! private String TESTDATA = "Here we go again";
private static final String ALIASEVE = "neu://eve@test";
--- 93,98 ----
! private final TestCaseSigner signer;
! private final String TESTDATA = "Here we go again";
private static final String ALIASEVE = "neu://eve@test";
|