You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pe...@us...> - 2003-10-31 23:58:56
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv502/src/java/org/neuclear/signers
Modified Files:
DefaultSigner.java
Log Message:
The IdentityCreator now fully works with the new Signer architecture.
Index: DefaultSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/DefaultSigner.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DefaultSigner.java 29 Oct 2003 21:16:28 -0000 1.1
--- DefaultSigner.java 31 Oct 2003 23:58:53 -0000 1.2
***************
*** 6,10 ****
import java.security.GeneralSecurityException;
- import java.security.KeyStore;
/*
--- 6,9 ----
***************
*** 28,31 ****
--- 27,33 ----
$Id$
$Log$
+ Revision 1.2 2003/10/31 23:58:53 pelle
+ The IdentityCreator now fully works with the new Signer architecture.
+
Revision 1.1 2003/10/29 21:16:28 pelle
Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
***************
*** 45,49 ****
public class DefaultSigner extends JCESigner {
public DefaultSigner(PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
! super(CryptoTools.DEFAULT_KEYSTORE, KeyStore.getDefaultType(), null, agent);
}
--- 47,51 ----
public class DefaultSigner extends JCESigner {
public DefaultSigner(PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
! super(CryptoTools.DEFAULT_KEYSTORE, "jks", "SUN", agent);
}
|
|
From: <pe...@us...> - 2003-10-31 23:58:32
|
Update of /cvsroot/neuclear/neuclear-pay/src/java
In directory sc8-pr-cvs1:/tmp/cvs-serv422/src/java
Modified Files:
neuclear-pay.xml
Log Message:
The IdentityCreator now fully works with the new Signer architecture.
Index: neuclear-pay.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/neuclear-pay.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** neuclear-pay.xml 29 Oct 2003 21:14:44 -0000 1.2
--- neuclear-pay.xml 31 Oct 2003 23:58:28 -0000 1.3
***************
*** 8,18 ****
<param type="java.lang.String">neu://superbux/reserve</param>
</component>
! <component class="org.neuclear.pay.PaymentReceiver">
<param type="java.lang.String">neu://superbux/reserve</param>
</component>
! <component type="org.neuclear.signer.Signer"
! class="org.neuclear.signer.JCESigner"/>
! <component type="org.neuclear.signer.PublicKeySource"
! class="org.neuclear.signer.JCESigner"/>
<component type="org.neuclear.passphraseagents.PassPhraseAgent"
class="org.neuclear.passphraseagents.GuiDialogAgent"/>
--- 8,16 ----
<param type="java.lang.String">neu://superbux/reserve</param>
</component>
! <component class="org.neuclear.pay.receiver.PaymentReceiver">
<param type="java.lang.String">neu://superbux/reserve</param>
</component>
! <component type="org.neudist.crypto.Signer"
! class="org.neuclear.signers.DefaultSigner"/>
<component type="org.neuclear.passphraseagents.PassPhraseAgent"
class="org.neuclear.passphraseagents.GuiDialogAgent"/>
|
|
From: <pe...@us...> - 2003-10-29 23:17:56
|
Update of /cvsroot/neuclear/neuclear-id In directory sc8-pr-cvs1:/tmp/cvs-serv22723 Modified Files: project.properties project.xml Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** project.properties 29 Sep 2003 23:17:31 -0000 1.3 --- project.properties 29 Oct 2003 23:17:53 -0000 1.4 *************** *** 16,21 **** maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/ maven.test.skip=false ! maven.uberjar.main = org.neuclear.signers.commandline.CommandLineSigner \ No newline at end of file --- 16,21 ---- maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ maven.test.skip=false ! maven.uberjar.main = org.neuclear.signers.commandline.CommandLineSigner Index: project.xml =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/project.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** project.xml 23 Oct 2003 22:02:37 -0000 1.8 --- project.xml 29 Oct 2003 23:17:53 -0000 1.9 *************** *** 6,10 **** <currentVersion>0.7-SNAPSHOT</currentVersion> <inceptionYear>2002</inceptionYear> ! <package>org.neuclear.id</package> <logo>/images/logo.gif</logo> <shortDescription>NeuClear Identity Framework</shortDescription> --- 6,10 ---- <currentVersion>0.7-SNAPSHOT</currentVersion> <inceptionYear>2002</inceptionYear> ! <package>org.neuclear</package> <logo>/images/logo.gif</logo> <shortDescription>NeuClear Identity Framework</shortDescription> |
|
From: <pe...@us...> - 2003-10-29 23:17:56
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers In directory sc8-pr-cvs1:/tmp/cvs-serv22723/src/java/org/neuclear/signers Modified Files: JCESigner.java SimpleSigner.java Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: JCESigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/JCESigner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JCESigner.java 29 Oct 2003 21:16:28 -0000 1.1 --- JCESigner.java 29 Oct 2003 23:17:53 -0000 1.2 *************** *** 2,5 **** --- 2,10 ---- * $Id$ * $Log$ + * Revision 1.2 2003/10/29 23:17:53 pelle + * Updated some javadocs + * Added a neuclear specific maven repository at: + * http://neuclear.org/maven/ and updated the properties files to reflect that. + * * Revision 1.1 2003/10/29 21:16:28 pelle * Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore. *************** *** 115,121 **** /** ! * Returns the PrivateKey corresponding to the given name. * ! * @param name Unique Name of PrivateKey * @param data Data to be signed * @return The signature --- 120,126 ---- /** ! * Signs the data with the privatekey of the given name * ! * @param name Alias of private key to be used within KeyStore * @param data Data to be signed * @return The signature Index: SimpleSigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/SimpleSigner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleSigner.java 29 Oct 2003 21:16:28 -0000 1.1 --- SimpleSigner.java 29 Oct 2003 23:17:53 -0000 1.2 *************** *** 2,5 **** --- 2,10 ---- * $Id$ * $Log$ + * Revision 1.2 2003/10/29 23:17:53 pelle + * Updated some javadocs + * Added a neuclear specific maven repository at: + * http://neuclear.org/maven/ and updated the properties files to reflect that. + * * Revision 1.1 2003/10/29 21:16:28 pelle * Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore. *************** *** 180,183 **** --- 185,197 ---- } + + /** + * Signs the data with the privatekey of the given name + * + * @param name Alias of private key to be used within KeyStore + * @param data Data to be signed + * @return The signature + * @throws InvalidPassphraseException if the passphrase doesn't match + */ public byte[] sign(String name, byte data[]) throws CryptoException { |
|
From: <pe...@us...> - 2003-10-29 23:16:50
|
Update of /cvsroot/neuclear/neuclear-commons In directory sc8-pr-cvs1:/tmp/cvs-serv22366 Modified Files: project.properties Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/project.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.properties 20 Sep 2003 23:18:11 -0000 1.1.1.1 --- project.properties 29 Oct 2003 23:16:47 -0000 1.2 *************** *** 18,20 **** maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/ --- 18,20 ---- maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ |
|
From: <pe...@us...> - 2003-10-29 23:16:26
|
Update of /cvsroot/neuclear/neuclear-ledger In directory sc8-pr-cvs1:/tmp/cvs-serv22292 Modified Files: project.properties Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/project.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.properties 20 Sep 2003 23:16:17 -0000 1.1.1.1 --- project.properties 29 Oct 2003 23:16:22 -0000 1.2 *************** *** 18,20 **** maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/ --- 18,20 ---- maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ |
|
From: <pe...@us...> - 2003-10-29 23:16:04
|
Update of /cvsroot/neuclear/neuclear-pay In directory sc8-pr-cvs1:/tmp/cvs-serv22200 Modified Files: project.properties Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/project.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.properties 20 Sep 2003 23:12:40 -0000 1.1.1.1 --- project.properties 29 Oct 2003 23:16:01 -0000 1.2 *************** *** 17,19 **** maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/ --- 17,19 ---- maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ |
|
From: <pe...@us...> - 2003-10-29 23:15:42
|
Update of /cvsroot/neuclear/neuclear-bet In directory sc8-pr-cvs1:/tmp/cvs-serv22122 Modified Files: project.properties Log Message: Updated some javadocs Added a neuclear specific maven repository at: http://neuclear.org/maven/ and updated the properties files to reflect that. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-bet/project.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.properties 20 Sep 2003 23:19:21 -0000 1.1.1.1 --- project.properties 29 Oct 2003 23:15:39 -0000 1.2 *************** *** 18,20 **** maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/ --- 18,20 ---- maven.jar.manifest.extensions.add = false #maven.ui.property.file = ui.properties ! maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ |
|
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;
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/signers
Added Files:
DefaultSigner.java InvalidPassphraseException.java
JCESigner.java NonExistingSignerException.java
PublicKeySource.java SimpleSigner.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.
--- NEW FILE: DefaultSigner.java ---
package org.neuclear.signers;
import org.neuclear.commons.NeuClearException;
import org.neuclear.passphraseagents.PassPhraseAgent;
import org.neudist.crypto.CryptoTools;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: DefaultSigner.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
$Log: DefaultSigner.java,v $
Revision 1.1 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.
*/
/**
* Easy to use preconfigured Signer that uses the standard default JCE KeyStore
* User: pelleb
* Date: Oct 29, 2003
* Time: 3:22:17 PM
*/
public class DefaultSigner extends JCESigner {
public DefaultSigner(PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
super(CryptoTools.DEFAULT_KEYSTORE, KeyStore.getDefaultType(), null, agent);
}
}
--- NEW FILE: InvalidPassphraseException.java ---
/*
* $Id: InvalidPassphraseException.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
* $Log: InvalidPassphraseException.java,v $
* Revision 1.1 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.2 2003/02/20 13:26:41 pelle
* Adding all of the modification from Rams?s Morales ra...@co... to support DSASHA1 Signatures
* Thanks Rams?s good work.
* So this means there is now support for:
* - DSA KeyInfo blocks
* - DSA Key Generation within CryptoTools
* - Signing using DSASHA1
*
* Revision 1.1 2003/02/18 00:03:32 pelle
* Moved the Signer classes from neudistframework into neudist-xmlsig
*
* Revision 1.2 2002/09/21 23:11:16 pelle
* A bunch of clean ups. Got rid of as many hard coded URL's as I could.
*
* User: pelleb
* Date: Sep 20, 2002
* Time: 12:39:46 PM
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.neuclear.signers;
import org.neudist.crypto.CryptoException;
public class InvalidPassphraseException extends CryptoException {
public InvalidPassphraseException() {
super("Passphrase incorrect.");
}
public InvalidPassphraseException(String msg) {
super(msg);
}
}
--- NEW FILE: JCESigner.java ---
/*
* $Id: JCESigner.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
* $Log: JCESigner.java,v $
* Revision 1.1 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:44:03 pelle
* The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase.
* The two Signer implementations both use it for the passphrase.
*
* Revision 1.3 2003/10/21 22:29:59 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
* Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy.
* Obviously had to perform many changes throughout the code to support these changes.
*
* Revision 1.2 2003/02/20 13:26:41 pelle
* Adding all of the modification from Rams?s Morales ra...@co... to support DSASHA1 Signatures
* Thanks Rams?s good work.
* So this means there is now support for:
* - DSA KeyInfo blocks
* - DSA Key Generation within CryptoTools
* - Signing using DSASHA1
*
* Revision 1.1 2003/02/18 00:03:32 pelle
* Moved the Signer classes from neudistframework into neudist-xmlsig
*
* Revision 1.2 2003/02/09 00:15:55 pelle
* Fixed things so they now compile with r_0.7 of XMLSig
*
* Revision 1.1 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.
* I have expanded the CommandLineSigner, so it now also has an option for specifying a default signing service.
* The default web application now contains two signers.
* - The Demo one is still at /Signer
* - There is a new one at /personal/Signer this uses the testkeys.ks for
* signing anything under neu://test
* Note neu://test now has a default interactive signer running on localhost.
* So to play with this you must install the webapp on your own local machine.
*
* Revision 1.2 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
* and decrypting it my self.
*
* Revision 1.1 2002/09/21 23:11:16 pelle
* A bunch of clean ups. Got rid of as many hard coded URL's as I could.
*
* User: pelleb
* Date: Sep 20, 2002
* Time: 12:37:32 PM
*/
package org.neuclear.signers;
import org.neuclear.commons.NeuClearException;
import org.neuclear.passphraseagents.PassPhraseAgent;
import org.neudist.crypto.CryptoException;
import org.neudist.crypto.CryptoTools;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.*;
/**
* Wrapper around JCE KeyStore
*/
public class JCESigner implements org.neudist.crypto.Signer, PublicKeySource {
public JCESigner(String filename, String type, String provider, PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
this.agent = agent;
try {
if (filename == null)
throw new NeuClearException("Filename not given for JCESigner");
File file = new File(filename);
if (provider == null)
ks = KeyStore.getInstance(type);
else
ks = KeyStore.getInstance(type, provider);
if (file.exists()) {
System.out.println("NEUDIST: Loading KeyStore");
FileInputStream in = new FileInputStream(file);
ks.load(in, agent.getPassPhrase("KeyStore Passphrase for: " + file.getAbsolutePath()));
} else
throw new NeuClearException("KeyStore: " + file.getPath() + " doesnt exist");
} catch (IOException e) {
throw new NeuClearException(e);
}
}
private PrivateKey getKey(String name, char passphrase[]) throws InvalidPassphraseException, NonExistingSignerException, IOException {
try {
PrivateKey key = (PrivateKey) ks.getKey(name, passphrase);
if (key == null)
throw new NonExistingSignerException("No keys for: " + name);
return key;
} catch (ClassCastException e) {
throw new NonExistingSignerException("Incorrect Key type found");
} catch (GeneralSecurityException e) {
throw new InvalidPassphraseException(e.getLocalizedMessage());
}
}
/**
* Returns the PrivateKey corresponding to the given name.
*
* @param name Unique Name of PrivateKey
* @param data Data to be signed
* @return The signature
* @throws InvalidPassphraseException if the passphrase doesn't match
*/
public byte[] sign(String name, byte data[]) throws CryptoException {
try {
return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data);
} catch (IOException e) {
throw new CryptoException(e);
}
}
public boolean canSignFor(String name) throws CryptoException {
try {
return ks.containsAlias(name);
} catch (KeyStoreException e) {
throw new CryptoException(e);
}
}
public PublicKey getPublicKey(String name) throws CryptoException {
try {
return ks.getCertificate(name).getPublicKey();
} catch (KeyStoreException e) {
throw new CryptoException(e);
}
}
private final KeyStore ks;
private final PassPhraseAgent agent;
}
--- NEW FILE: NonExistingSignerException.java ---
/*
* $Id: NonExistingSignerException.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
* $Log: NonExistingSignerException.java,v $
* Revision 1.1 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.2 2003/02/20 13:26:41 pelle
* Adding all of the modification from Rams?s Morales ra...@co... to support DSASHA1 Signatures
* Thanks Rams?s good work.
* So this means there is now support for:
* - DSA KeyInfo blocks
* - DSA Key Generation within CryptoTools
* - Signing using DSASHA1
*
* Revision 1.1 2003/02/18 00:03:32 pelle
* Moved the Signer classes from neudistframework into neudist-xmlsig
*
* Revision 1.2 2002/09/21 23:11:16 pelle
* A bunch of clean ups. Got rid of as many hard coded URL's as I could.
*
* User: pelleb
* Date: Sep 21, 2002
* Time: 2:48:29 PM
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.neuclear.signers;
import org.neudist.crypto.CryptoException;
public class NonExistingSignerException extends CryptoException {
public NonExistingSignerException() {
super("Couldnt Sign. Non existent key.");
}
public NonExistingSignerException(String name) {
super("Couldnt sign for: " + name);
}
}
--- NEW FILE: PublicKeySource.java ---
package org.neuclear.signers;
import org.neudist.crypto.CryptoException;
import java.security.PublicKey;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: PublicKeySource.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
$Log: PublicKeySource.java,v $
Revision 1.1 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.
*/
/**
* User: pelleb
* Date: Oct 29, 2003
* Time: 2:15:58 PM
*/
public interface PublicKeySource {
PublicKey getPublicKey(String name) throws CryptoException;
}
--- NEW FILE: SimpleSigner.java ---
/*
* $Id: SimpleSigner.java,v 1.1 2003/10/29 21:16:28 pelle Exp $
* $Log: SimpleSigner.java,v $
* Revision 1.1 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:44:03 pelle
* The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase.
* The two Signer implementations both use it for the passphrase.
*
* Revision 1.3 2003/10/21 22:29:59 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
* Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy.
* Obviously had to perform many changes throughout the code to support these changes.
*
* Revision 1.2 2003/02/20 13:26:41 pelle
* Adding all of the modification from Rams?s Morales ra...@co... to support DSASHA1 Signatures
* Thanks Rams?s good work.
* So this means there is now support for:
* - DSA KeyInfo blocks
* - DSA Key Generation within CryptoTools
* - Signing using DSASHA1
*
* Revision 1.1 2003/02/18 00:03:32 pelle
* Moved the Signer classes from neudistframework into neudist-xmlsig
*
* Revision 1.5 2003/02/10 22:30:13 pelle
* Got rid of even further dependencies. In Particular OSCore
*
* Revision 1.4 2003/02/09 00:15:55 pelle
* Fixed things so they now compile with r_0.7 of XMLSig
*
* Revision 1.3 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.
* I have expanded the CommandLineSigner, so it now also has an option for specifying a default signing service.
* The default web application now contains two signers.
* - The Demo one is still at /Signer
* - There is a new one at /personal/Signer this uses the testkeys.ks for
* signing anything under neu://test
* Note neu://test now has a default interactive signer running on localhost.
* So to play with this you must install the webapp on your own local machine.
*
* Revision 1.2 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
* and decrypting it my self.
*
* Revision 1.1 2002/09/21 23:11:16 pelle
* A bunch of clean ups. Got rid of as many hard coded URL's as I could.
*
* User: pelleb
* Date: Sep 20, 2002
* Time: 12:37:32 PM
*/
package org.neuclear.signers;
import org.neuclear.commons.NeuClearException;
import org.neuclear.passphraseagents.PassPhraseAgent;
import org.neudist.crypto.CryptoException;
import org.neudist.crypto.CryptoTools;
import org.neudist.crypto.Signer;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import java.io.*;
import java.security.GeneralSecurityException;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;
/**
* Simple memory based implementation of Signer.
* Currently it doesnt even use the passphrase. However it does do a SHA1 digest on the name first.
*/
public class SimpleSigner implements Signer {
public SimpleSigner(String file, PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
this.agent = agent;
try {
signerFile = new File(file);
if (signerFile.exists()) {
System.out.println("NEUDIST: Loading KeyStore");
FileInputStream in = new FileInputStream(signerFile);
ObjectInputStream s = new ObjectInputStream(in);
ks = (HashMap) s.readObject();
} else
ks = new HashMap();
kf = KeyFactory.getInstance("RSA", "BC");
} catch (IOException e) {
throw new NeuClearException(e);
} catch (ClassNotFoundException e) {
throw new NeuClearException(e);
}
}
private PrivateKey getKey(String name, char passphrase[]) throws CryptoException, NonExistingSignerException {
System.out.println("NEUDIST: UnSealing key " + name + " ...");
byte encrypted[] = (byte[]) ks.get(getDigestedName(name));
if (encrypted == null)
throw new NonExistingSignerException("Signer " + name + "doesnt exist in this Store");
ByteArrayInputStream bis = new ByteArrayInputStream(encrypted);
byte keyBytes[] = new byte[0];
try {
Cipher c = CryptoTools.makePBECipher(Cipher.DECRYPT_MODE, passphrase);
CipherInputStream cin = new CipherInputStream(bis, c);
DataInputStream din = new DataInputStream(cin);
//byte keyBytes[]=new byte[c.getOutputSize(encrypted.length)];
if (din.readInt() != 11870) //This is just a quick check to see if the passphrase worked
throw new InvalidPassphraseException("Passphrase Didnt Match");
int i = din.readInt();
// Sanity Check
if (i > 5000)
throw new InvalidPassphraseException("Returned key is too big");
keyBytes = new byte[i];
din.readFully(keyBytes, 0, keyBytes.length);
din.close();
KeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
return kf.generatePrivate(spec);
} catch (GeneralSecurityException e) {
throw new InvalidPassphraseException(e.getLocalizedMessage());
} catch (IOException e) {
throw new CryptoException(e);
}
}
/**
* Adds the given key to the store.
*
* @param name The name to store it as
* @param passphrase The passphrase to encrypt the key
* @param key The PrivateKey itself.
*/
public void addKey(String name, char passphrase[], PrivateKey key) throws GeneralSecurityException, IOException {
System.out.println("NEUDIST: Sealing key: " + name + " in format " + key.getFormat());
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DataOutputStream dOut = new DataOutputStream(bOut);
Cipher c = CryptoTools.makePBECipher(Cipher.ENCRYPT_MODE, passphrase);
CipherOutputStream cOut = new CipherOutputStream(dOut, c);
dOut = new DataOutputStream(cOut);
dOut.writeInt(11870);//This is just a quick check to see if the passphrase worked
byte keyBytes[] = key.getEncoded(); //I'm assuming this is PKCS8, If not tough dooda
dOut.writeInt(keyBytes.length);
dOut.write(keyBytes);
dOut.close();
byte encrypted[] = bOut.toByteArray();
ks.put(getDigestedName(name), encrypted);
}
public boolean canSignFor(String name) throws CryptoException {
return ks.containsKey(getDigestedName(name));
}
static final protected String getDigestedName(String name) {
return new String(CryptoTools.digest(name.getBytes()));
}
public void save() throws IOException {
if (signerFile.getParent() != null)
signerFile.getParentFile().mkdirs();
FileOutputStream f = new FileOutputStream(signerFile);
ObjectOutput s = new ObjectOutputStream(f);
s.writeObject(ks);
s.flush();
}
public byte[] sign(String name, byte data[]) throws CryptoException {
return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data);
}
private KeyFactory kf;
private Map ks;
private final File signerFile;
private final PassPhraseAgent agent;
}
|
|
From: <pe...@us...> - 2003-10-29 21:16:31
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/store
Modified Files:
EncryptedFileStore.java FileStore.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: EncryptedFileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/EncryptedFileStore.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** EncryptedFileStore.java 21 Oct 2003 22:31:14 -0000 1.7
--- EncryptedFileStore.java 29 Oct 2003 21:16:28 -0000 1.8
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.8 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.7 2003/10/21 22:31:14 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 72,76 ****
*
* Revision 1.4 2002/09/23 15:09:18 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
--- 79,83 ----
*
* Revision 1.4 2002/09/23 15:09:18 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
***************
*** 143,152 ****
-
/**
* We need both a simple FileStore and an encrypted one. The encrypted one stores each object using a filename generated through
* a Hashing system of some sort. The files themselves are encrypted using perhaps their name and a store specific code. The filetimes would also be set to a
* uniform time, so if the operator was sopeanad(Spelling) i
- *
*/
public class EncryptedFileStore extends FileStore {
--- 150,157 ----
Index: FileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/FileStore.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** FileStore.java 21 Oct 2003 22:31:14 -0000 1.7
--- FileStore.java 29 Oct 2003 21:16:28 -0000 1.8
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.8 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.7 2003/10/21 22:31:14 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 59,63 ****
*
* Revision 1.4 2002/09/23 15:09:18 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
--- 66,70 ----
*
* Revision 1.4 2002/09/23 15:09:18 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
***************
*** 131,139 ****
//import org.neuclear.id.NSDLObject;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.verifier.VerifyingReader;
- import org.neuclear.commons.NeuClearException;
import org.neudist.xml.XMLException;
--- 138,146 ----
//import org.neuclear.id.NSDLObject;
+ import org.neuclear.commons.NeuClearException;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.verifier.VerifyingReader;
import org.neudist.xml.XMLException;
***************
*** 147,151 ****
* a Hashing system of some sort. The files themselves are encrypted using perhaps their name and a store specific code. The filetimes would also be set to a
* uniform time, so if the operator was sopeanad(Spelling) i
- *
*/
public class FileStore extends Store {
--- 154,157 ----
|
|
From: <pe...@us...> - 2003-10-29 21:16:31
|
Update of /cvsroot/neuclear/neuclear-id/src/java
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java
Added Files:
neuclear-id.xml
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.
--- NEW FILE: neuclear-id.xml ---
<components>
<component type="org.neudist.crypto.Signer"
class="org.neuclear.signers.DefaultSigner"/>
<component type="org.neuclear.signers.PublicKeySource"
class="org.neuclear.signers.DefaultSigner"/>
<component type="org.neuclear.passphraseagents.PassPhraseAgent"
class="org.neuclear.passphraseagents.GuiDialogAgent"/>
</components>
|
|
From: <pe...@us...> - 2003-10-29 21:16:31
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/signers/servlet
Modified Files:
DemoSigningServlet.java SigningServlet.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: DemoSigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/DemoSigningServlet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DemoSigningServlet.java 21 Oct 2003 22:31:13 -0000 1.6
--- DemoSigningServlet.java 29 Oct 2003 21:16:27 -0000 1.7
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.7 2003/10/29 21:16:27 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.6 2003/10/21 22:31:13 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 45,49 ****
*
* Revision 1.6 2003/02/18 00:06:15 pelle
! * Moved the SignerStore's into xml-sig
*
* Revision 1.5 2003/02/14 21:10:36 pelle
--- 52,56 ----
*
* Revision 1.6 2003/02/18 00:06:15 pelle
! * Moved the Signer's into xml-sig
*
* Revision 1.5 2003/02/14 21:10:36 pelle
***************
*** 66,70 ****
* Revision 1.1 2002/10/06 00:39:29 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.
--- 73,77 ----
* Revision 1.1 2002/10/06 00:39:29 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.
***************
*** 104,108 ****
*
* Revision 1.5 2002/09/23 15:09:18 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
--- 111,115 ----
*
* Revision 1.5 2002/09/23 15:09:18 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
***************
*** 120,137 ****
package org.neuclear.signers.servlet;
! import org.neuclear.id.InvalidIdentityException;
! import org.neuclear.id.NSTools;
! import org.neuclear.id.Identity;
! import org.neudist.crypto.signerstores.SignerStore;
! import org.neudist.crypto.signerstores.SimpleSignerStore;
! import org.neuclear.commons.NeuClearException;
!
! import javax.servlet.ServletConfig;
! import javax.servlet.ServletException;
! import java.io.File;
! import java.io.FileInputStream;
! import java.io.IOException;
! import java.security.*;
! import java.security.interfaces.RSAPrivateKey;
public class DemoSigningServlet extends SigningServlet {
--- 127,131 ----
package org.neuclear.signers.servlet;
! import java.security.KeyPairGenerator;
public class DemoSigningServlet extends SigningServlet {
***************
*** 159,163 ****
System.out.println("NEUDIST: Generating key and Identity for: " + name);
KeyPair kp = kpg.generateKeyPair();
! ((SimpleSignerStore) getKeyStore()).addKey(name, newPassword.toCharArray(), kp.getPrivate());
System.out.println("NEUDIST: Creating Identity");
Identity ns = new Identity(name, kp.getPublic(), "http://neuclear.org:8080/neudistframework/Store", "http://neuclear.org:8080/neudistframework/Signer", "http://neuclear.org:8080/neudistframework/Logger", "");//TODO Fix these values
--- 153,157 ----
System.out.println("NEUDIST: Generating key and Identity for: " + name);
KeyPair kp = kpg.generateKeyPair();
! ((SimpleSigner) getKeyStore()).addKey(name, newPassword.toCharArray(), kp.getPrivate());
System.out.println("NEUDIST: Creating Identity");
Identity ns = new Identity(name, kp.getPublic(), "http://neuclear.org:8080/neudistframework/Store", "http://neuclear.org:8080/neudistframework/Signer", "http://neuclear.org:8080/neudistframework/Logger", "");//TODO Fix these values
***************
*** 189,194 ****
}
! protected static SignerStore getKeyStore(File keyStoreFile, Object kspassword) throws GeneralSecurityException, IOException, NeuClearException {
! return new SimpleSignerStore(keyStoreFile);
}
--- 183,188 ----
}
! protected static Signer getKeyStore(File keyStoreFile, Object kspassword) throws GeneralSecurityException, IOException, NeuClearException {
! return new SimpleSigner(keyStoreFile);
}
Index: SigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/SigningServlet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SigningServlet.java 21 Oct 2003 22:31:13 -0000 1.6
--- SigningServlet.java 29 Oct 2003 21:16:27 -0000 1.7
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.7 2003/10/29 21:16:27 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.6 2003/10/21 22:31:13 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 42,46 ****
*
* Revision 1.16 2003/02/18 00:06:15 pelle
! * Moved the SignerStore's into xml-sig
*
* Revision 1.15 2003/02/14 21:10:36 pelle
--- 49,53 ----
*
* Revision 1.16 2003/02/18 00:06:15 pelle
! * Moved the Signer's into xml-sig
*
* Revision 1.15 2003/02/14 21:10:36 pelle
***************
*** 82,86 ****
* Revision 1.9 2002/10/06 00:39:29 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.
--- 89,93 ----
* Revision 1.9 2002/10/06 00:39:29 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.
***************
*** 120,124 ****
*
* Revision 1.5 2002/09/23 15:09:18 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
--- 127,131 ----
*
* Revision 1.5 2002/09/23 15:09:18 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
***************
*** 136,158 ****
package org.neuclear.signers.servlet;
! import org.dom4j.DocumentException;
! import org.dom4j.DocumentHelper;
! import org.dom4j.Element;
! import org.dom4j.io.OutputFormat;
! import org.dom4j.io.XMLWriter;
! import org.neuclear.id.InvalidIdentityException;
! import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.receiver.ReceiverServlet;
! import org.neudist.crypto.signerstores.InvalidPassphraseException;
! import org.neudist.crypto.signerstores.JCESignerStore;
! import org.neudist.crypto.signerstores.NonExistingSignerException;
! import org.neudist.crypto.signerstores.SignerStore;
! import org.neuclear.commons.NeuClearException;
import org.neudist.utils.ServletTools;
import org.neudist.utils.Utility;
- import org.neudist.xml.soap.SOAPException;
- import org.neudist.xml.xmlsec.XMLSecTools;
- import org.neudist.xml.xmlsec.XMLSecurityException;
import javax.servlet.ServletConfig;
--- 143,153 ----
package org.neuclear.signers.servlet;
! import org.neuclear.commons.configuration.Configuration;
! import org.neuclear.commons.configuration.ConfigurationException;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.receiver.ReceiverServlet;
! import org.neudist.crypto.Signer;
import org.neudist.utils.ServletTools;
import org.neudist.utils.Utility;
import javax.servlet.ServletConfig;
***************
*** 160,170 ****
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
- import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
- import java.io.StringWriter;
- import java.security.GeneralSecurityException;
- import java.security.KeyPairGenerator;
- import java.security.PrivateKey;
public class SigningServlet extends ReceiverServlet {
--- 155,160 ----
***************
*** 176,204 ****
System.out.println("NEUDIST: Initialising SigningServlet");
title = Utility.denullString(config.getInitParameter("title").toString(), "NeuDist Signing Service");
! File keyStoreFile = new File(config.getServletContext().getRealPath(Utility.denullString(config.getInitParameter("keystore"), System.getProperty("user.home") + "/.neuclear/signers.ks")));
! System.out.println("NEUDIST: Using KeyStore: " + keyStoreFile.getAbsolutePath());
! // ks=KeyStore.getInstance("JKS");
! // char password[]=Utility.denullString(config.getInitParameter("keystore.passphrase"),"SuperDuper").toCharArray();
! // if (!keyStoreFile.exists()) {
! // System.out.println("NEUDIST: Creating KeyStore ");
! // ks.load(null,password);
! if (ks == null) {
! ks = getKeyStore(keyStoreFile, config.getInitParameter("keystore.password"));
}
- // if (keyStoreFile.getParent()!=null)
- // keyStoreFile.getParentFile().mkdirs();
- // ks.store(new FileOutputStream(keyStoreFile),password);
- // } else {
- // System.out.println("NEUDIST: Loading KeyStore: ");
- // ks.load(new FileInputStream(keyStoreFile),password);
- // }
System.out.println("NEUDIST: Finished SigningServlet Init ");
! } catch (GeneralSecurityException e) {
! e.printStackTrace(System.out);
! } catch (IOException e) {
! e.printStackTrace(System.out);
! } catch (NeuClearException e) {
! e.printStackTrace(System.out);
}
--- 166,176 ----
System.out.println("NEUDIST: Initialising SigningServlet");
title = Utility.denullString(config.getInitParameter("title").toString(), "NeuDist Signing Service");
! if (signer == null) {
! signer = (Signer) Configuration.getComponent(Signer.class, "neuclear-id");
}
System.out.println("NEUDIST: Finished SigningServlet Init ");
! } catch (ConfigurationException e) {
! e.printStackTrace();
}
***************
*** 206,216 ****
}
- protected static SignerStore getKeyStore(File keyStoreFile, String kspassword) throws GeneralSecurityException, IOException, NeuClearException {
- return new JCESignerStore(keyStoreFile, kspassword.toCharArray());
- }
-
! protected static final SignerStore getKeyStore() {
! return ks;
}
--- 178,184 ----
}
! protected static final Signer getSigner() {
! return signer;
}
***************
*** 339,343 ****
try {
String parentName = NSTools.getParentNSURI(obj.getName());
! PrivateKey pk = ks.getKey(parentName, passphrase);
if (pk == null)
throw new NonExistingSignerException("Signing Service doesn't contain Signing keys for: " + parentName);
--- 307,311 ----
try {
String parentName = NSTools.getParentNSURI(obj.getName());
! PrivateKey pk = signer.getKey(parentName, passphrase);
if (pk == null)
throw new NonExistingSignerException("Signing Service doesn't contain Signing keys for: " + parentName);
***************
*** 357,362 ****
*/
protected javax.servlet.ServletContext context;
! private static SignerStore ks;
! private KeyPairGenerator kpg;
private String title;
--- 325,329 ----
*/
protected javax.servlet.ServletContext context;
! private static Signer signer;
private String title;
|
|
From: <pe...@us...> - 2003-10-29 21:16:31
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/test/org/neuclear/store
Modified Files:
AbstractStoreTest.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: AbstractStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/AbstractStoreTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AbstractStoreTest.java 21 Oct 2003 22:31:15 -0000 1.6
--- AbstractStoreTest.java 29 Oct 2003 21:16:28 -0000 1.7
***************
*** 2,5 ****
--- 2,12 ----
$Id$
$Log$
+ Revision 1.7 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.6 2003/10/21 22:31:15 pelle
Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 110,116 ****
import junit.framework.TestCase;
- import org.neuclear.id.InvalidIdentityException;
- import org.neuclear.id.builders.IdentityBuilder;
import org.neuclear.commons.NeuClearException;
import org.neudist.xml.xmlsec.XMLSecurityException;
--- 117,122 ----
import junit.framework.TestCase;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.id.InvalidIdentityException;
import org.neudist.xml.xmlsec.XMLSecurityException;
***************
*** 155,167 ****
public void testStore() throws NeuClearException, InvalidIdentityException, XMLSecurityException {
! System.out.println("\nTesting " + this.getClass().getName());
! System.out.println("Storing " + rootName);
! store.receive(new IdentityBuilder(rootName, root.getPrivate(), root.getPublic()));
! System.out.println("Storing " + bobName);
! store.receive(new IdentityBuilder(bobName, root.getPrivate(), bob.getPublic()));
! System.out.println("Storing " + bobAliceName);
! store.receive(new IdentityBuilder(bobAliceName, bob.getPrivate(), alice.getPublic()));
! System.out.println("Storing " + eveName);
! store.receive(new IdentityBuilder(eveName, root.getPrivate(), eve.getPublic()));
/* TODO: To complete this part I need to have a parent testkey in a keystore that is signed by root.
System.out.println("Fetching "+rootName);
--- 161,173 ----
public void testStore() throws NeuClearException, InvalidIdentityException, XMLSecurityException {
! // System.out.println("\nTesting " + this.getClass().getName());
! // System.out.println("Storing " + rootName);
! // store.receive(new IdentityBuilder(rootName, root.getPrivate(), root.getPublic()));
! // System.out.println("Storing " + bobName);
! // store.receive(new IdentityBuilder(bobName, root.getPrivate(), bob.getPublic()));
! // System.out.println("Storing " + bobAliceName);
! // store.receive(new IdentityBuilder(bobAliceName, bob.getPrivate(), alice.getPublic()));
! // System.out.println("Storing " + eveName);
! // store.receive(new IdentityBuilder(eveName, root.getPrivate(), eve.getPublic()));
/* TODO: To complete this part I need to have a parent testkey in a keystore that is signed by root.
System.out.println("Fetching "+rootName);
|
|
From: <pe...@us...> - 2003-10-29 21:16:30
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/signers/commandline Modified Files: CommandLineSigner.java IdentityCreator.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: CommandLineSigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/CommandLineSigner.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CommandLineSigner.java 28 Oct 2003 23:44:35 -0000 1.9 --- CommandLineSigner.java 29 Oct 2003 21:16:27 -0000 1.10 *************** *** 1,7 **** /* $Id$ * $Log$ * Revision 1.9 2003/10/28 23:44:35 pelle ! * The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two SignerStore implementations both use it for the passphrase. * * Revision 1.8 2003/10/25 00:39:54 pelle --- 1,14 ---- /* $Id$ * $Log$ + * Revision 1.10 2003/10/29 21:16:27 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.9 2003/10/28 23:44:35 pelle ! * The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two Signer implementations both use it for the passphrase. * * Revision 1.8 2003/10/25 00:39:54 pelle *************** *** 57,61 **** * * Revision 1.12 2003/02/18 00:06:15 pelle ! * Moved the SignerStore's into xml-sig * * Revision 1.11 2003/02/16 00:26:18 pelle --- 64,68 ---- * * Revision 1.12 2003/02/18 00:06:15 pelle ! * Moved the Signer's into xml-sig * * Revision 1.11 2003/02/16 00:26:18 pelle *************** *** 105,109 **** * Revision 1.3 2002/10/06 00:39:29 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. --- 112,116 ---- * Revision 1.3 2002/10/06 00:39:29 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. *************** *** 141,147 **** --- 148,157 ---- import org.apache.commons.cli.*; import org.dom4j.Document; + import org.neuclear.commons.configuration.Configuration; + import org.neuclear.commons.configuration.ConfigurationException; import org.neuclear.id.SignedNamedObject; import org.neuclear.id.builders.NamedObjectBuilder; import org.neudist.crypto.CryptoTools; + import org.neudist.crypto.Signer; import org.neudist.utils.Utility; import org.neudist.xml.XMLException; *************** *** 149,154 **** import java.io.*; - import java.security.*; - import java.security.cert.CertificateException; /** --- 159,162 ---- *************** *** 157,161 **** */ public class CommandLineSigner { ! public CommandLineSigner(String args[]) throws ParseException, NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException { CryptoTools.ensureProvider(); --- 165,169 ---- */ public class CommandLineSigner { ! public CommandLineSigner(String args[]) throws ParseException, ConfigurationException { CryptoTools.ensureProvider(); *************** *** 165,169 **** cmd = clparser.parse(options, args); checkArguments(); ! ks = loadKeyStore(); alias = cmd.getOptionValue("a"); of = cmd.getOptionValue("o"); --- 173,178 ---- cmd = clparser.parse(options, args); checkArguments(); ! // agent=(PassPhraseAgent)Configuration.getComponent(PassPhraseAgent.class,"neuclear-id"); ! sig = (Signer) Configuration.getComponent(Signer.class, "neuclear-id"); alias = cmd.getOptionValue("a"); of = cmd.getOptionValue("o"); *************** *** 206,224 **** String password = Utility.denullString(cmd.getOptionValue("p"), cmd.getOptionValue("j")); // If we dont specify a password it defaults to ks password ! KeyPair kp = CryptoTools.getKeyPair(ks, alias, password.toCharArray()); ! ! if (kp == null) { System.err.println("Key with alias: " + alias + " doesnt exist"); System.exit(1); } - PrivateKey key = kp.getPrivate(); System.err.println("Signing by " + alias + " ..."); ! subject.sign(key); ! System.err.print("Verifying..."); ! if (subject.verifySignature(kp.getPublic())) ! System.err.println("ok"); ! else ! System.err.println("FAIL"); } --- 215,225 ---- String password = Utility.denullString(cmd.getOptionValue("p"), cmd.getOptionValue("j")); // If we dont specify a password it defaults to ks password ! if (sig.canSignFor(alias)) { System.err.println("Key with alias: " + alias + " doesnt exist"); System.exit(1); } System.err.println("Signing by " + alias + " ..."); ! subject.sign(alias, sig); } *************** *** 240,253 **** } - private KeyStore loadKeyStore() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { - String ksf = cmd.getOptionValue("s"); - String kstype = cmd.getOptionValue("t"); - String kspassword = cmd.getOptionValue("j"); - File keystoreFile = new File(Utility.denullString(ksf, keystore)); - KeyStore ks = KeyStore.getInstance(Utility.denullString(kstype, KeyStore.getDefaultType())); - ks.load(new FileInputStream(keystoreFile), Utility.denullString(kspassword).toCharArray()); - return ks; - } - protected NamedObjectBuilder build() throws Exception { String sf = cmd.getOptionValue("i"); --- 241,244 ---- *************** *** 275,283 **** // add t option ! options.addOption("s", "keystore", true, "specify KeyStore"); ! options.addOption("t", "keystoretype", true, "specify KeyStore Type"); ! options.addOption("j", "keystorepassword", true, "specify KeyStore Password"); options.addOption("a", "alias", true, "specify Key Alias in KeyStore"); ! options.addOption("p", "password", true, "specify Alias Password"); options.addOption("o", "outputfile", true, "specify Output File"); --- 266,274 ---- // add t option ! // options.addOption("s", "keystore", true, "specify KeyStore"); ! // options.addOption("t", "keystoretype", true, "specify KeyStore Type"); ! // options.addOption("j", "keystorepassword", true, "specify KeyStore Password"); options.addOption("a", "alias", true, "specify Key Alias in KeyStore"); ! // options.addOption("p", "password", true, "specify Alias Password"); options.addOption("o", "outputfile", true, "specify Output File"); *************** *** 295,300 **** protected Options options; public final static String keystore = System.getProperty("user.home") + "/.keystore"; ! protected final KeyStore ks; protected String alias; protected String of; } --- 286,293 ---- protected Options options; public final static String keystore = System.getProperty("user.home") + "/.keystore"; ! protected final Signer sig; ! // protected final PassPhraseAgent agent; protected String alias; protected String of; + } Index: IdentityCreator.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/IdentityCreator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdentityCreator.java 25 Oct 2003 00:39:54 -0000 1.1 --- IdentityCreator.java 29 Oct 2003 21:16:27 -0000 1.2 *************** *** 1,4 **** --- 1,11 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/10/29 21:16:27 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.1 2003/10/25 00:39:54 pelle * Fixed SmtpSender it now sends the messages. *************** *** 53,57 **** * * Revision 1.12 2003/02/18 00:06:15 pelle ! * Moved the SignerStore's into xml-sig * * Revision 1.11 2003/02/16 00:26:18 pelle --- 60,64 ---- * * Revision 1.12 2003/02/18 00:06:15 pelle ! * Moved the Signer's into xml-sig * * Revision 1.11 2003/02/16 00:26:18 pelle *************** *** 101,105 **** * Revision 1.3 2002/10/06 00:39:29 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. --- 108,112 ---- * Revision 1.3 2002/10/06 00:39:29 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. *************** *** 136,139 **** --- 143,147 ---- import org.apache.commons.cli.Options; + import org.neuclear.commons.configuration.Configuration; import org.neuclear.id.NSTools; import org.neuclear.id.builders.IdentityBuilder; *************** *** 141,148 **** import org.neuclear.id.resolver.NSResolver; import org.neuclear.senders.LogSender; import org.neudist.utils.Utility; import java.security.PublicKey; - import java.security.cert.Certificate; /** --- 149,157 ---- import org.neuclear.id.resolver.NSResolver; import org.neuclear.senders.LogSender; + import org.neuclear.signers.PublicKeySource; + import org.neudist.crypto.CryptoException; import org.neudist.utils.Utility; import java.security.PublicKey; /** *************** *** 156,159 **** --- 165,170 ---- of = Utility.denullString(of, "." + NSTools.url2path(identity) + "/root.id"); alias = Utility.denullString(alias, NSTools.getParentNSURI(identity)); + pksource = (PublicKeySource) Configuration.getComponent(PublicKeySource.class, "neuclear-id"); + } *************** *** 164,178 **** String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER); String defaultreceiver = cmd.getOptionValue("b"); ! PublicKey newkid; ! if (!Utility.isEmpty(allow)) { ! Certificate cert = ks.getCertificate(allow); ! if (cert == null) { ! System.err.println("PublicKey: " + allow + " doesnt exist in key store"); ! System.exit(1); ! } ! newkid = cert.getPublicKey(); ! } else ! newkid = ks.getCertificate(alias).getPublicKey(); //Self Sign return new IdentityBuilder(identity, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver); } --- 175,183 ---- String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER); String defaultreceiver = cmd.getOptionValue("b"); ! final PublicKey newkid = pksource.getPublicKey(allow); ! if (newkid == null) ! throw new CryptoException("PublicKey not available for: " + allow); return new IdentityBuilder(identity, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver); + } *************** *** 203,206 **** } ! private String identity; } --- 208,212 ---- } ! private final String identity; ! private final PublicKeySource pksource; } |
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/passphraseagents
Added Files:
CommandLineAgent.java GuiDialogAgent.java PassPhraseAgent.java
neuclear.png
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.
--- NEW FILE: CommandLineAgent.java ---
package org.neuclear.passphraseagents;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: CommandLineAgent.java,v 1.1 2003/10/29 21:16:27 pelle Exp $
$Log: CommandLineAgent.java,v $
Revision 1.1 2003/10/29 21:16:27 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.
*/
/**
* User: pelleb
* Date: Oct 29, 2003
* Time: 11:53:29 AM
*/
public class CommandLineAgent implements PassPhraseAgent {
public char[] getPassPhrase(String name) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please enter passphrase for: " + name);
System.out.print(": ");
try {
//TODO Figure out how to mask input
return reader.readLine().toCharArray();
} catch (IOException e) {
System.err.println("Couldnt read line. Returning empty passphrase");
return "".toCharArray();
}
}
public static void main(String args[]) {
PassPhraseAgent dia = new CommandLineAgent();
System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
System.exit(0);
}
}
--- NEW FILE: GuiDialogAgent.java ---
package org.neuclear.passphraseagents;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: GuiDialogAgent.java,v 1.1 2003/10/29 21:16:27 pelle Exp $
$Log: GuiDialogAgent.java,v $
Revision 1.1 2003/10/29 21:16:27 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.1 2003/10/28 23:44:03 pelle
The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase.
The two Signer implementations both use it for the passphrase.
*/
/**
* User: pelleb
* Date: Oct 27, 2003
* Time: 5:49:14 PM
*/
public final class GuiDialogAgent implements PassPhraseAgent {
public GuiDialogAgent() {
frame = new Frame("Please Enter Passphrase...");
frame.setVisible(false);
frame.setSize(200, 100);
Panel panel = new Panel();
panel.setLayout(new BorderLayout());
frame.add(panel);
Panel text = new Panel(new FlowLayout());
panel.add(text, BorderLayout.NORTH);
java.awt.MediaTracker tracker = new java.awt.MediaTracker(text);
img = Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource("org/neuclear/passphraseagents/neuclear.png"));
tracker.addImage(img, 0);
try {
tracker.waitForID(0);
Canvas canvas = new Canvas() {
public void paint(Graphics g) {
setSize(50, 50);
g.drawImage(img, 0, 0, this);
}
};
canvas.setSize(50, 50);
text.add(canvas);
System.out.println("Added image");
} catch (InterruptedException ex) {
System.out.println("Couldn't load Image");
}
text.add(new Label("Name: "));
nameLabel = new Label();
nameLabel.setForeground(Color.blue);
text.add(nameLabel);
passphrase = new TextField();
passphrase.setEchoChar('*');
panel.add(passphrase, BorderLayout.CENTER);
Panel buttons = new Panel(new FlowLayout());
panel.add(buttons, BorderLayout.SOUTH);
ok = new Button("Sign");
buttons.add(ok);
Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.setText("");
passphrase.notifyAll();
}
}
});
ActionListener action = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.notifyAll();
}
}
};
ok.addActionListener(action);
passphrase.addActionListener(action);
}
public char[] getPassPhrase(String name) {
synchronized (passphrase) {
passphrase.setText("");
nameLabel.setText(name);
frame.pack();
frame.setVisible(true);
try {
passphrase.wait();
} catch (InterruptedException e) {
;
}
frame.setVisible(false);
final String phrase = passphrase.getText();
passphrase.setText("");
return phrase.toCharArray();
}
}
public static void main(String args[]) {
PassPhraseAgent dia = new GuiDialogAgent();
System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
System.exit(0);
}
private TextField passphrase;
private Button ok;
private Label nameLabel;
private Frame frame;
private Image img;
}
--- NEW FILE: PassPhraseAgent.java ---
package org.neuclear.passphraseagents;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: PassPhraseAgent.java,v 1.1 2003/10/29 21:16:27 pelle Exp $
$Log: PassPhraseAgent.java,v $
Revision 1.1 2003/10/29 21:16:27 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.
*/
/**
* This interface is used to retrieve passphrases either interactively
* or from a configuration file.
* User: pelleb
* Date: Oct 29, 2003
* Time: 11:47:39 AM
*/
public interface PassPhraseAgent {
char[] getPassPhrase(String name);
}
--- NEW FILE: neuclear.png ---
(This appears to be a binary file; contents omitted.)
|
|
From: <pe...@us...> - 2003-10-29 21:16:30
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/id/builders
Modified Files:
IdentityBuilder.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: IdentityBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/IdentityBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** IdentityBuilder.java 21 Oct 2003 22:31:12 -0000 1.4
--- IdentityBuilder.java 29 Oct 2003 21:16:27 -0000 1.5
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.5 2003/10/29 21:16:27 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/21 22:31:12 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 28,32 ****
*
* Revision 1.10 2003/02/18 00:06:15 pelle
! * Moved the SignerStore's into xml-sig
*
* Revision 1.9 2003/02/16 00:22:59 pelle
--- 35,39 ----
*
* Revision 1.10 2003/02/18 00:06:15 pelle
! * Moved the Signer's into xml-sig
*
* Revision 1.9 2003/02/16 00:22:59 pelle
***************
*** 151,161 ****
import org.neuclear.id.Identity;
import org.neuclear.id.NSTools;
- import org.neuclear.commons.NeuClearException;
import org.neudist.utils.Utility;
import org.neudist.xml.xmlsec.XMLSecTools;
import org.neudist.xml.xmlsec.XMLSecurityException;
- import org.neudist.xml.XMLException;
- import java.security.PrivateKey;
import java.security.PublicKey;
--- 158,166 ----
import org.neuclear.id.Identity;
import org.neuclear.id.NSTools;
import org.neudist.utils.Utility;
+ import org.neudist.xml.XMLException;
import org.neudist.xml.xmlsec.XMLSecTools;
import org.neudist.xml.xmlsec.XMLSecurityException;
import java.security.PublicKey;
***************
*** 166,176 ****
* This constructor should be used by subclasses of NameSpace. It creates a Standard NameSpace document, but doesn't sign it.
* The signing should be done as the last step of the constructor of the subclass.
! * @param name The Name of NameSpace
! * @param allow PublicKey allowed to sign in here
* @param repository URL of Default Store for NameSpace. (Note. A NameSpace object is stored in the default repository of it's parent namespace)
! * @param signer URL of default interactive signing service for namespace. If null it doesnt allow interactive signing
! * @param receiver URL of default receiver for namespace
*/
! public IdentityBuilder(String name, PublicKey allow, String repository, String signer, String logger, String receiver) {
super(name, "Identity");
--- 171,182 ----
* This constructor should be used by subclasses of NameSpace. It creates a Standard NameSpace document, but doesn't sign it.
* The signing should be done as the last step of the constructor of the subclass.
! *
! * @param name The Name of NameSpace
! * @param allow PublicKey allowed to sign in here
* @param repository URL of Default Store for NameSpace. (Note. A NameSpace object is stored in the default repository of it's parent namespace)
! * @param signer URL of default interactive signing service for namespace. If null it doesnt allow interactive signing
! * @param receiver URL of default receiver for namespace
*/
! public IdentityBuilder(String name, PublicKey allow, String repository, String signer, String logger, String receiver) {
super(name, "Identity");
***************
*** 200,207 ****
}
- public IdentityBuilder(String name, PrivateKey signer, PublicKey allow) throws XMLSecurityException {
- this(name, allow);
- sign(signer);
- }
public String getTagName() {
--- 206,209 ----
|
|
From: <pe...@us...> - 2003-10-29 21:16:30
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id In directory sc8-pr-cvs1:/tmp/cvs-serv29589/src/java/org/neuclear/id Modified Files: Identity.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: Identity.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Identity.java 25 Oct 2003 00:39:54 -0000 1.9 --- Identity.java 29 Oct 2003 21:16:27 -0000 1.10 *************** *** 2,5 **** --- 2,12 ---- * $Id$ * $Log$ + * Revision 1.10 2003/10/29 21:16:27 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.9 2003/10/25 00:39:54 pelle * Fixed SmtpSender it now sends the messages. *************** *** 67,71 **** * * Revision 1.10 2003/02/18 00:06:15 pelle ! * Moved the SignerStore's into xml-sig * * Revision 1.9 2003/02/16 00:22:59 pelle --- 74,78 ---- * * Revision 1.10 2003/02/18 00:06:15 pelle ! * Moved the Signer's into xml-sig * * Revision 1.9 2003/02/16 00:22:59 pelle |
|
From: <pe...@us...> - 2003-10-29 21:15:16
|
Update of /cvsroot/neuclear/neuclear-ledger/src/test/org/neuclear/ledger In directory sc8-pr-cvs1:/tmp/cvs-serv29261/src/test/org/neuclear/ledger Modified Files: LedgerTest.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: LedgerTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/test/org/neuclear/ledger/LedgerTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LedgerTest.java 28 Oct 2003 23:43:15 -0000 1.2 --- LedgerTest.java 29 Oct 2003 21:15:13 -0000 1.3 *************** *** 15,22 **** * $Id$ * $Log$ ! * Revision 1.2 2003/10/28 23:43:15 pelle ! * The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two SignerStore implementations both use it for the passphrase. * * Revision 1.1.1.1 2003/09/20 23:16:21 pelle * First revision of neuclear-ledger in /cvsroot/neuclear --- 15,29 ---- * $Id$ * $Log$ ! * Revision 1.3 2003/10/29 21:15:13 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.2 2003/10/28 23:43:15 pelle + * The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase. + * The two Signer implementations both use it for the passphrase. + * <p/> * Revision 1.1.1.1 2003/09/20 23:16:21 pelle * First revision of neuclear-ledger in /cvsroot/neuclear |
|
From: <pe...@us...> - 2003-10-29 21:15:16
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger In directory sc8-pr-cvs1:/tmp/cvs-serv29261/src/java/org/neuclear/ledger Modified Files: Ledger.java LedgerFactory.java UnPostedTransaction.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: Ledger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/Ledger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Ledger.java 28 Oct 2003 23:43:14 -0000 1.4 --- Ledger.java 29 Oct 2003 21:15:12 -0000 1.5 *************** *** 4,10 **** * $Id$ * $Log$ * Revision 1.4 2003/10/28 23:43:14 pelle ! * The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two SignerStore implementations both use it for the passphrase. * * Revision 1.3 2003/10/25 00:39:05 pelle --- 4,17 ---- * $Id$ * $Log$ + * Revision 1.5 2003/10/29 21:15:12 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:43:14 pelle ! * The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two Signer implementations both use it for the passphrase. * * Revision 1.3 2003/10/25 00:39:05 pelle Index: LedgerFactory.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/LedgerFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LedgerFactory.java 28 Oct 2003 23:43:15 -0000 1.3 --- LedgerFactory.java 29 Oct 2003 21:15:13 -0000 1.4 *************** *** 8,14 **** * $Id$ * $Log$ * Revision 1.3 2003/10/28 23:43:15 pelle ! * The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two SignerStore implementations both use it for the passphrase. * * Revision 1.2 2003/10/25 00:39:05 pelle --- 8,21 ---- * $Id$ * $Log$ + * Revision 1.4 2003/10/29 21:15:13 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.3 2003/10/28 23:43:15 pelle ! * The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two Signer implementations both use it for the passphrase. * * Revision 1.2 2003/10/25 00:39:05 pelle Index: UnPostedTransaction.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/UnPostedTransaction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UnPostedTransaction.java 28 Oct 2003 23:43:15 -0000 1.3 --- UnPostedTransaction.java 29 Oct 2003 21:15:13 -0000 1.4 *************** *** 8,14 **** * $Id$ * $Log$ * Revision 1.3 2003/10/28 23:43:15 pelle ! * The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two SignerStore implementations both use it for the passphrase. * * Revision 1.2 2003/10/01 17:35:53 pelle --- 8,21 ---- * $Id$ * $Log$ + * Revision 1.4 2003/10/29 21:15:13 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.3 2003/10/28 23:43:15 pelle ! * The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase. ! * The two Signer implementations both use it for the passphrase. * * Revision 1.2 2003/10/01 17:35:53 pelle |
|
From: <pe...@us...> - 2003-10-29 21:14:48
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/pay/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv29147/src/test/org/neuclear/pay/receiver
Modified Files:
CreateTestPayments.java PaymentReceiverTest.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: CreateTestPayments.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/pay/receiver/CreateTestPayments.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CreateTestPayments.java 25 Oct 2003 00:46:29 -0000 1.1
--- CreateTestPayments.java 29 Oct 2003 21:14:44 -0000 1.2
***************
*** 3,6 ****
--- 3,7 ----
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+ import org.neuclear.commons.configuration.ConfigurationException;
import org.neuclear.id.NSTools;
import org.neuclear.id.builders.NamedObjectBuilder;
***************
*** 33,36 ****
--- 34,44 ----
$Id$
$Log$
+ Revision 1.2 2003/10/29 21:14:44 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.1 2003/10/25 00:46:29 pelle
Added tests to test the PaymentReceiver.
***************
*** 45,49 ****
*/
public class CreateTestPayments extends CommandLineSigner {
! public CreateTestPayments(String[] args) throws ParseException, NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
super(args);
}
--- 53,57 ----
*/
public class CreateTestPayments extends CommandLineSigner {
! public CreateTestPayments(String[] args) throws ParseException, NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, ConfigurationException {
super(args);
}
Index: PaymentReceiverTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/pay/receiver/PaymentReceiverTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PaymentReceiverTest.java 28 Oct 2003 23:42:47 -0000 1.2
--- PaymentReceiverTest.java 29 Oct 2003 21:14:45 -0000 1.3
***************
*** 3,6 ****
--- 3,7 ----
import org.dom4j.DocumentException;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.configuration.Configuration;
import org.neuclear.commons.configuration.ConfigurationException;
import org.neuclear.id.SignedNamedObject;
***************
*** 36,42 ****
$Id$
$Log$
Revision 1.2 2003/10/28 23:42:47 pelle
! The PassPhraseDialogue now works. It simply presents itself as a simple modal dialog box asking for a passphrase.
! The two SignerStore implementations both use it for the passphrase.
Revision 1.1 2003/10/25 00:46:29 pelle
--- 37,50 ----
$Id$
$Log$
+ Revision 1.3 2003/10/29 21:14:45 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.2 2003/10/28 23:42:47 pelle
! The GuiDialogAgent now works. It simply presents itself as a simple modal dialog box asking for a passphrase.
! The two Signer implementations both use it for the passphrase.
Revision 1.1 2003/10/25 00:46:29 pelle
***************
*** 54,59 ****
public PaymentReceiverTest(String string) throws LowlevelLedgerException, LedgerCreationException, ConfigurationException {
super(string);
! proc = PaymentProcessor.getInstance();
! receiver = new PaymentReceiver(proc, "neu://test/pay");
}
--- 62,67 ----
public PaymentReceiverTest(String string) throws LowlevelLedgerException, LedgerCreationException, ConfigurationException {
super(string);
! proc = (PaymentProcessor) Configuration.getComponent(PaymentProcessor.class, "neuclear-pay");
! receiver = (PaymentReceiver) Configuration.getComponent(PaymentReceiver.class, "neuclear-pay");
}
|
|
From: <pe...@us...> - 2003-10-29 21:14:47
|
Update of /cvsroot/neuclear/neuclear-pay/src/java
In directory sc8-pr-cvs1:/tmp/cvs-serv29147/src/java
Modified Files:
neuclear-pay.xml
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: neuclear-pay.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/neuclear-pay.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** neuclear-pay.xml 28 Oct 2003 23:42:47 -0000 1.1
--- neuclear-pay.xml 29 Oct 2003 21:14:44 -0000 1.2
***************
*** 8,10 ****
--- 8,20 ----
<param type="java.lang.String">neu://superbux/reserve</param>
</component>
+ <component class="org.neuclear.pay.PaymentReceiver">
+ <param type="java.lang.String">neu://superbux/reserve</param>
+ </component>
+ <component type="org.neuclear.signer.Signer"
+ class="org.neuclear.signer.JCESigner"/>
+ <component type="org.neuclear.signer.PublicKeySource"
+ class="org.neuclear.signer.JCESigner"/>
+ <component type="org.neuclear.passphraseagents.PassPhraseAgent"
+ class="org.neuclear.passphraseagents.GuiDialogAgent"/>
+
</components>
|
|
From: <pe...@us...> - 2003-10-29 21:14:47
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv29147/src/java/org/neuclear/pay/receiver
Modified Files:
PaymentReceiver.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: PaymentReceiver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/receiver/PaymentReceiver.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PaymentReceiver.java 25 Oct 2003 00:38:43 -0000 1.4
--- PaymentReceiver.java 29 Oct 2003 21:14:44 -0000 1.5
***************
*** 13,21 ****
import org.neuclear.receiver.Receiver;
import org.neuclear.receiver.UnsupportedTransaction;
import org.neudist.xml.ElementProxy;
import org.neudist.xml.xmlsec.XMLSecurityException;
- import java.security.PrivateKey;
-
/*
NeuClear Distributed Transaction Clearing Platform
--- 13,20 ----
import org.neuclear.receiver.Receiver;
import org.neuclear.receiver.UnsupportedTransaction;
+ import org.neudist.crypto.Signer;
import org.neudist.xml.ElementProxy;
import org.neudist.xml.xmlsec.XMLSecurityException;
/*
NeuClear Distributed Transaction Clearing Platform
***************
*** 45,52 ****
public class PaymentReceiver implements Receiver {
! public PaymentReceiver(PaymentProcessor proc, String asset) {
this.proc = proc;
this.asset = asset;
! this.signer = null;
}
--- 44,51 ----
public class PaymentReceiver implements Receiver {
! public PaymentReceiver(PaymentProcessor proc, Signer signer, String asset) {
this.proc = proc;
this.asset = asset;
! this.signer = signer;
}
***************
*** 68,72 ****
PaymentReceipt receipt = from.pay(to, transfer.getAmount(), transfer.getTimeStamp(), "transfer");
TransferReceiptBuilder sigReceipt = new TransferReceiptBuilder(receipt);
! sigReceipt.sign(signer);
return sigReceipt;
//TODO do something with receipt
--- 67,71 ----
PaymentReceipt receipt = from.pay(to, transfer.getAmount(), transfer.getTimeStamp(), "transfer");
TransferReceiptBuilder sigReceipt = new TransferReceiptBuilder(receipt);
! sigReceipt.sign(asset, signer);
return sigReceipt;
//TODO do something with receipt
***************
*** 94,98 ****
private final PaymentProcessor proc;
private final String asset;
! private PrivateKey signer;
{
--- 93,97 ----
private final PaymentProcessor proc;
private final String asset;
! private Signer signer;
{
|
|
From: <pe...@us...> - 2003-10-29 20:51:52
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neudist/crypto In directory sc8-pr-cvs1:/tmp/cvs-serv24592/src/java/org/neudist/crypto Log Message: Directory /cvsroot/neuclear/neuclear-id/src/java/org/neudist/crypto added to the repository |
|
From: <pe...@us...> - 2003-10-29 20:51:33
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neudist In directory sc8-pr-cvs1:/tmp/cvs-serv24533/src/java/org/neudist Log Message: Directory /cvsroot/neuclear/neuclear-id/src/java/org/neudist added to the repository |