|
From: <pe...@us...> - 2003-11-21 04:45:26
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/jce
In directory sc8-pr-cvs1:/tmp/cvs-serv10855/src/test/org/neuclear/id/jce
Modified Files:
NeuClearJCETest.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: NeuClearJCETest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/jce/NeuClearJCETest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NeuClearJCETest.java 20 Nov 2003 23:42:24 -0000 1.4
--- NeuClearJCETest.java 21 Nov 2003 04:45:17 -0000 1.5
***************
*** 36,39 ****
--- 36,45 ----
$Id$
$Log$
+ Revision 1.5 2003/11/21 04:45:17 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.4 2003/11/20 23:42:24 pelle
Getting all the tests to work in id
***************
*** 65,70 ****
* Time: 11:50:58 AM
*/
! public class NeuClearJCETest extends AbstractSigningTest {
! public NeuClearJCETest(String string) throws NeuClearException, GeneralSecurityException {
super(string);
if (Security.getProvider("NeuClear") == null) {
--- 71,76 ----
* Time: 11:50:58 AM
*/
! public final class NeuClearJCETest extends AbstractSigningTest {
! public NeuClearJCETest(final String string) throws NeuClearException, GeneralSecurityException {
super(string);
if (Security.getProvider("NeuClear") == null) {
***************
*** 74,107 ****
}
! public void testProvider() {
assertNotNull(Security.getProvider("NeuClear"));
}
! public void testCertificateFactory() throws CertificateException {
assertNotNull(CertificateFactory.getInstance("NeuClear"));
}
! public void testGetCertificate() throws NeuClearException, XMLException {
! IdentityBuilder id = new IdentityBuilder("neu://bob@test", signer.getPublicKey("neu://bob@test"));
! Identity bob = (Identity) id.sign(signer);
! Certificate cert = bob.getCertificate();
assertNotNull(cert);
assertEquals(cert.getPublicKey(), bob.getPublicKey());
}
! public void testStoreKey() throws NeuClearException, XMLException, NoSuchProviderException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException {
! KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "BC");
! KeyStore ks = KeyStore.getInstance("jks", "SUN");
ks.load(null, null);
kpg.initialize(512);
! KeyPair kp = kpg.generateKeyPair();
! JCESigner sig2 = new JCESigner(ks, new AlwaysTheSamePassphraseAgent("neuclear"));
! IdentityBuilder id = new IdentityBuilder("neu://eve@test", kp.getPublic());
! Identity eve = (Identity) id.sign(signer);
ks.setKeyEntry("neu://eve@test", kp.getPrivate(), "neuclear".toCharArray(), eve.getCertificateChain());
! AuthenticationTicketBuilder authb = new AuthenticationTicketBuilder("neu://eve@test", "neu://test", "http://users.neuclear.org:8080");
//authb.sign(sig2);
--- 80,113 ----
}
! public final void testProvider() {
assertNotNull(Security.getProvider("NeuClear"));
}
! public final void testCertificateFactory() throws CertificateException {
assertNotNull(CertificateFactory.getInstance("NeuClear"));
}
! public final void testGetCertificate() throws NeuClearException, XMLException {
! final IdentityBuilder id = new IdentityBuilder("neu://bob@test", signer.getPublicKey("neu://bob@test"));
! final Identity bob = (Identity) id.sign(signer);
! final Certificate cert = bob.getCertificate();
assertNotNull(cert);
assertEquals(cert.getPublicKey(), bob.getPublicKey());
}
! public final void testStoreKey() throws NeuClearException, XMLException, NoSuchProviderException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException {
! final KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "BC");
! final KeyStore ks = KeyStore.getInstance("jks", "SUN");
ks.load(null, null);
kpg.initialize(512);
! final KeyPair kp = kpg.generateKeyPair();
! final JCESigner sig2 = new JCESigner(ks, new AlwaysTheSamePassphraseAgent("neuclear"));
! final IdentityBuilder id = new IdentityBuilder("neu://eve@test", kp.getPublic());
! final Identity eve = (Identity) id.sign(signer);
ks.setKeyEntry("neu://eve@test", kp.getPrivate(), "neuclear".toCharArray(), eve.getCertificateChain());
! final AuthenticationTicketBuilder authb = new AuthenticationTicketBuilder("neu://eve@test", "neu://test", "http://users.neuclear.org:8080");
//authb.sign(sig2);
|