|
From: <pe...@us...> - 2003-10-29 21:16:31
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/test/org/neuclear/signers
Modified Files:
SimpleSignerStoreTest.java
Log Message:
Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
To use it you pass a byte array and an alias. The sign method then returns the signature.
If a Signer needs a passphrase it uses a PassPhraseAgent to present a dialogue box, read it from a command line etc.
This new Signer pattern allows us to use secure signing hardware such as N-Cipher in the future for server applications as well
as SmartCards for end user applications.
Index: SimpleSignerStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/signers/SimpleSignerStoreTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SimpleSignerStoreTest.java 28 Oct 2003 23:56:04 -0000 1.4
--- SimpleSignerStoreTest.java 29 Oct 2003 21:16:28 -0000 1.5
***************
*** 1,6 ****
/* $Id$
* $Log$
* Revision 1.4 2003/10/28 23:56:04 pelle
! * Fixed the SimpleSignerStore unit test to verify the next functionality of the SignerStore interface.
*
* Revision 1.3 2003/10/21 22:31:15 pelle
--- 1,13 ----
/* $Id$
* $Log$
+ * Revision 1.5 2003/10/29 21:16:28 pelle
+ * Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
+ * To use it you pass a byte array and an alias. The sign method then returns the signature.
+ * If a Signer needs a passphrase it uses a PassPhraseAgent to present a dialogue box, read it from a command line etc.
+ * This new Signer pattern allows us to use secure signing hardware such as N-Cipher in the future for server applications as well
+ * as SmartCards for end user applications.
+ *
* Revision 1.4 2003/10/28 23:56:04 pelle
! * Fixed the SimpleSigner unit test to verify the next functionality of the Signer interface.
*
* Revision 1.3 2003/10/21 22:31:15 pelle
***************
*** 23,27 ****
*
* Revision 1.4 2003/02/18 00:06:15 pelle
! * Moved the SignerStore's into xml-sig
*
* Revision 1.3 2003/02/10 22:30:24 pelle
--- 30,34 ----
*
* Revision 1.4 2003/02/18 00:06:15 pelle
! * Moved the Signer's into xml-sig
*
* Revision 1.3 2003/02/10 22:30:24 pelle
***************
*** 41,45 ****
* Revision 1.2 2002/10/06 00:39:26 pelle
* I have now expanded support for different types of Signers.
! * There is now a JCESignerStore which uses a JCE KeyStore for signing.
* I have refactored the SigningServlet a bit, eliminating most of the demo code.
* This has been moved into DemoSigningServlet.
--- 48,52 ----
* Revision 1.2 2002/10/06 00:39:26 pelle
* I have now expanded support for different types of Signers.
! * There is now a JCESigner which uses a JCE KeyStore for signing.
* I have refactored the SigningServlet a bit, eliminating most of the demo code.
* This has been moved into DemoSigningServlet.
***************
*** 53,57 ****
*
* Revision 1.1 2002/09/23 15:09:11 pelle
! * Got the SimpleSignerStore working properly.
* I couldn't get SealedObjects working with BouncyCastle's Symmetric keys.
* Don't know what I was doing, so I reimplemented it. Encrypting
--- 60,64 ----
*
* Revision 1.1 2002/09/23 15:09:11 pelle
! * Got the SimpleSigner working properly.
* I couldn't get SealedObjects working with BouncyCastle's Symmetric keys.
* Don't know what I was doing, so I reimplemented it. Encrypting
***************
*** 63,71 ****
import junit.framework.TestCase;
import org.neuclear.commons.NeuClearException;
import org.neudist.crypto.CryptoException;
import org.neudist.crypto.CryptoTools;
- import org.neudist.crypto.signerstores.SimpleSignerStore;
- import java.io.File;
import java.io.IOException;
import java.security.GeneralSecurityException;
--- 70,79 ----
import junit.framework.TestCase;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.configuration.Configuration;
+ import org.neuclear.commons.configuration.ConfigurationException;
+ import org.neuclear.passphraseagents.PassPhraseAgent;
import org.neudist.crypto.CryptoException;
import org.neudist.crypto.CryptoTools;
import java.io.IOException;
import java.security.GeneralSecurityException;
***************
*** 80,84 ****
*/
public class SimpleSignerStoreTest extends TestCase {
! public SimpleSignerStoreTest(String name) throws GeneralSecurityException, NeuClearException {
super(name);
store = getSignerStoreInstance();
--- 88,92 ----
*/
public class SimpleSignerStoreTest extends TestCase {
! public SimpleSignerStoreTest(String name) throws GeneralSecurityException, NeuClearException, ConfigurationException {
super(name);
store = getSignerStoreInstance();
***************
*** 88,94 ****
/**
*/
! public static SimpleSignerStore getSignerStoreInstance() throws NeuClearException, GeneralSecurityException {
! return new SimpleSignerStore(new File("target/tests/keystores"));
}
--- 96,103 ----
/**
*/
! public static SimpleSigner getSignerStoreInstance() throws NeuClearException, GeneralSecurityException, ConfigurationException {
! return new SimpleSigner("target/tests/keystores",
! (PassPhraseAgent) Configuration.getComponent(PassPhraseAgent.class, "neuclear-id"));
}
***************
*** 139,143 ****
! private SimpleSignerStore store;
private static KeyPairGenerator kg;
protected static KeyPair root;
--- 148,152 ----
! private SimpleSigner store;
private static KeyPairGenerator kg;
protected static KeyPair root;
|