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-12-19 00:31:33
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver
In directory sc8-pr-cvs1:/tmp/cvs-serv19108/src/java/org/neuclear/id/resolver
Modified Files:
NSResolver.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: NSResolver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver/NSResolver.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** NSResolver.java 11 Dec 2003 23:57:29 -0000 1.15
--- NSResolver.java 19 Dec 2003 00:31:30 -0000 1.16
***************
*** 2,9 ****
import org.neuclear.commons.NeuClearException;
! import org.neuclear.id.Identity;
! import org.neuclear.id.InvalidNamedObjectException;
! import org.neuclear.id.NSTools;
! import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.cache.NSCache;
import org.neuclear.source.Source;
--- 2,6 ----
import org.neuclear.commons.NeuClearException;
! import org.neuclear.id.*;
import org.neuclear.id.cache.NSCache;
import org.neuclear.source.Source;
***************
*** 32,40 ****
* @return
*/
! public final static Identity resolveIdentity(final String name) throws NeuClearException, InvalidNamedObjectException {
final SignedNamedObject id = resolve(name);
if (id instanceof Identity)
return (Identity) id;
! throw new InvalidNamedObjectException(name + " is not a valid Identity");
}
--- 29,37 ----
* @return
*/
! public final static Identity resolveIdentity(final String name) throws NameResolutionException, NeuClearException,InvalidNamedObjectException {
final SignedNamedObject id = resolve(name);
if (id instanceof Identity)
return (Identity) id;
! throw new InvalidNamedObjectException(name);
}
***************
*** 47,51 ****
* @return
*/
! public final static SignedNamedObject resolve(final String name) throws NeuClearException, InvalidNamedObjectException {
SignedNamedObject obj = NSCACHE.fetchCached(name);
if (obj != null)
--- 44,48 ----
* @return
*/
! public final static SignedNamedObject resolve(final String name) throws NameResolutionException,NeuClearException, InvalidNamedObjectException {
SignedNamedObject obj = NSCACHE.fetchCached(name);
if (obj != null)
***************
*** 64,68 ****
obj = Source.getInstance().fetch(store, name);
if (obj == null)
! throw new NeuClearException("Identity: " + name + " was not resolved");
NSCACHE.cache(obj);
return obj; //This may not be null
--- 61,65 ----
obj = Source.getInstance().fetch(store, name);
if (obj == null)
! throw new NameResolutionException(name);
NSCACHE.cache(obj);
return obj; //This may not be null
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons/crypto/signers
Modified Files:
DefaultSigner.java JCESigner.java ServletSignerFactory.java
SimpleSigner.java TestCaseSigner.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: DefaultSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/DefaultSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultSigner.java 21 Nov 2003 04:43:41 -0000 1.3
--- DefaultSigner.java 19 Dec 2003 00:31:15 -0000 1.4
***************
*** 3,7 ****
--- 3,9 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.CryptoTools;
+ import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent;
+ import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
import java.io.FileNotFoundException;
***************
*** 28,31 ****
--- 30,36 ----
$Id$
$Log$
+ Revision 1.4 2003/12/19 00:31:15 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.3 2003/11/21 04:43:41 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 63,67 ****
*/
public final class DefaultSigner extends JCESigner {
! public DefaultSigner(final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
super(CryptoTools.DEFAULT_KEYSTORE, "jks", "SUN", agent);
--- 68,72 ----
*/
public final class DefaultSigner extends JCESigner {
! public DefaultSigner(final PassPhraseAgent agent) throws UserCancellationException,InvalidPassphraseException {
super(CryptoTools.DEFAULT_KEYSTORE, "jks", "SUN", agent);
Index: JCESigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/JCESigner.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** JCESigner.java 18 Dec 2003 17:40:07 -0000 1.12
--- JCESigner.java 19 Dec 2003 00:31:15 -0000 1.13
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.13 2003/12/19 00:31:15 pelle
+ * Lots of usability changes through out all the passphrase agents and end user tools.
+ *
* Revision 1.12 2003/12/18 17:40:07 pelle
* You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
***************
*** 136,144 ****
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.commons.crypto.jce.RawCertificate;
import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent;
! import org.neuclear.commons.crypto.passphraseagents.UserCancelsException;
import java.io.*;
--- 139,149 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
+ import org.neuclear.commons.LowLevelException;
import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.commons.crypto.jce.RawCertificate;
import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent;
! import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
! import org.neuclear.commons.crypto.passphraseagents.InteractiveAgent;
import java.io.*;
***************
*** 160,168 ****
* @param provider
* @param agent
! * @throws NeuClearException
! * @throws GeneralSecurityException
! * @throws FileNotFoundException
*/
! public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
this(filename, createInputStream(filename), type, provider, agent);
this.filename=filename;
--- 165,172 ----
* @param provider
* @param agent
! * @throws InvalidPassphraseException If the given passphrase is incorrect
! * @throws UserCancellationException If the user choses to cancel the process in the passphrase agent, this should cancel the loading process
*/
! public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent) throws UserCancellationException,InvalidPassphraseException {
this(filename, createInputStream(filename), type, provider, agent);
this.filename=filename;
***************
*** 175,183 ****
* @param agent
* @param initialpassphrase
! * @throws NeuClearException
! * @throws GeneralSecurityException
! * @throws FileNotFoundException
*/
! public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent,final char[] initialpassphrase) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
this(filename, createInputStream(filename), type, provider, agent,initialpassphrase);
this.filename=filename;
--- 179,186 ----
* @param agent
* @param initialpassphrase
! * @throws InvalidPassphraseException If the given passphrase is incorrect
*/
! public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent,final char[] initialpassphrase) throws InvalidPassphraseException
! {
this(filename, createInputStream(filename), type, provider, agent,initialpassphrase);
this.filename=filename;
***************
*** 189,195 ****
* @param filename
* @return
- * @throws FileNotFoundException
*/
! private static InputStream createInputStream(final String filename) throws FileNotFoundException {
if (Utility.isEmpty(filename))
return null;
--- 192,197 ----
* @param filename
* @return
*/
! private static InputStream createInputStream(final String filename) {
if (Utility.isEmpty(filename))
return null;
***************
*** 197,201 ****
if (!file.exists())
return null;
! return new FileInputStream(file);
}
--- 199,208 ----
if (!file.exists())
return null;
! try {
! return new FileInputStream(file);
! } catch (FileNotFoundException e) {
! System.err.println(e.getLocalizedMessage());
! throw new LowLevelException(e);
! }
}
***************
*** 207,213 ****
* @param provider
* @param agent
! * @throws NeuClearException
*/
! protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException {
this(loadKeyStore(provider, type, in, agent, name), agent);
}
--- 214,221 ----
* @param provider
* @param agent
! * @throws InvalidPassphraseException If the given passphrase is incorrect
! * @throws UserCancellationException If the user choses to cancel the process in the passphrase agent, this should cancel the loading process
*/
! protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent) throws UserCancellationException, InvalidPassphraseException {
this(loadKeyStore(provider, type, in, agent, name), agent);
}
***************
*** 220,234 ****
* @param agent
* @param initpassphrase
! * @throws NeuClearException
*/
! protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent, final char[] initpassphrase) throws NeuClearException {
this(loadKeyStore(provider, type, in, initpassphrase), agent);
}
!
! private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final PassPhraseAgent agent, final String name) throws NeuClearException {
// System.out.println("Loading JCESigner: "+name);
return loadKeyStore(provider,type,in,agent.getPassPhrase("Keystore password for: "+name));
}
! private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final char[] passphrase) throws NeuClearException {
// System.out.println("Loading JCESigner using passphrase: "+new String(passphrase));
try {
--- 228,261 ----
* @param agent
* @param initpassphrase
! * @throws InvalidPassphraseException If the given passphrase is incorrect
*/
! protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent, final char[] initpassphrase) throws InvalidPassphraseException {
this(loadKeyStore(provider, type, in, initpassphrase), agent);
}
! /**
! *
! * @param provider
! * @param type
! * @param in
! * @param agent
! * @param name
! * @return
! * @throws InvalidPassphraseException
! * @throws UserCancellationException
! */
! private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final PassPhraseAgent agent, final String name) throws InvalidPassphraseException,UserCancellationException {
// System.out.println("Loading JCESigner: "+name);
return loadKeyStore(provider,type,in,agent.getPassPhrase("Keystore password for: "+name));
}
! /**
! *
! * @param provider
! * @param type
! * @param in
! * @param passphrase
! * @return
! * @throws InvalidPassphraseException
! */
! private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final char[] passphrase) throws InvalidPassphraseException {
// System.out.println("Loading JCESigner using passphrase: "+new String(passphrase));
try {
***************
*** 241,257 ****
return ki;
} catch (KeyStoreException e) {
! throw new NeuClearException(e);
} catch (NoSuchProviderException e) {
! throw new NeuClearException(e);
} catch (IOException e) {
! throw new NeuClearException(e);
} catch (NoSuchAlgorithmException e) {
! throw new NeuClearException(e);
} catch (CertificateException e) {
! throw new NeuClearException(e);
}
}
! public JCESigner(final KeyStore ks, final PassPhraseAgent agent) throws CryptoException {
this.agent = agent;
this.ks = ks;
--- 268,290 ----
return ki;
} catch (KeyStoreException e) {
! throw new LowLevelException(e);
} catch (NoSuchProviderException e) {
! throw new LowLevelException(e);
} catch (IOException e) {
! System.err.println("Incorrect Passphrase");
! throw new InvalidPassphraseException("entered passphrase was invalid");
} catch (NoSuchAlgorithmException e) {
! throw new LowLevelException(e);
} catch (CertificateException e) {
! throw new LowLevelException(e);
}
}
! /**
! * Creates a signer based on a fully loaded keystore
! * @param ks
! * @param agent
! */
! public JCESigner(final KeyStore ks, final PassPhraseAgent agent) {
this.agent = agent;
this.ks = ks;
***************
*** 261,270 ****
kpg.initialize(1024, SecureRandom.getInstance("SHA1PRNG"));
} catch (NoSuchAlgorithmException e) {
! throw new CryptoException(e);
}
}
! private PrivateKey getKey(final String name, final char[] passphrase) throws InvalidPassphraseException, NonExistingSignerException, IOException {
try {
final PrivateKey key = (PrivateKey) cache.getKey(name, passphrase);
--- 294,303 ----
kpg.initialize(1024, SecureRandom.getInstance("SHA1PRNG"));
} catch (NoSuchAlgorithmException e) {
! throw new LowLevelException(e);
}
}
! private PrivateKey getKey(final String name, final char[] passphrase) throws UnrecoverableKeyException, NonExistingSignerException, NoSuchAlgorithmException, KeyStoreException {
try {
final PrivateKey key = (PrivateKey) cache.getKey(name, passphrase);
***************
*** 274,279 ****
} catch (ClassCastException e) {
throw new NonExistingSignerException("Incorrect Key type found");
- } catch (GeneralSecurityException e) {
- throw new InvalidPassphraseException(e.getLocalizedMessage());
}
--- 307,310 ----
***************
*** 290,299 ****
*/
public final byte[] sign(final String name, final byte[] data) throws CryptoException {
!
try {
! return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data);
! } catch (IOException e) {
! throw new CryptoException(e);
}
}
--- 321,345 ----
*/
public final byte[] sign(final String name, final byte[] data) throws CryptoException {
! return sign(name,data,false);
! }
! public final byte[] sign(final String name, final byte[] data,boolean incorrect) throws UserCancellationException, NonExistingSignerException,CryptoException {
try {
! final char[] pass = getPassPhrase(name,incorrect);
! return CryptoTools.sign(getKey(name, pass), data);
! } catch (UnrecoverableKeyException e) {
! System.err.println("Incorrect Passphrase Attemt on: "+name);
! return sign(name,data,true);
! } catch (NoSuchAlgorithmException e) {
! throw new LowLevelException(e);
! } catch (KeyStoreException e) {
! // Could try to reload it here but I wont for now
! throw new LowLevelException(e);
}
+ }
+
+ private char[] getPassPhrase(final String name,boolean incorrect) throws UserCancellationException {
+ if (incorrect&&(agent instanceof InteractiveAgent))
+ ((InteractiveAgent)agent).getPassPhrase(name,true);
+ return agent.getPassPhrase(name);
}
Index: ServletSignerFactory.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/ServletSignerFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ServletSignerFactory.java 16 Dec 2003 23:16:40 -0000 1.4
--- ServletSignerFactory.java 19 Dec 2003 00:31:15 -0000 1.5
***************
*** 57,61 ****
}
! private static final PassPhraseAgent createWrapperAgent(final String keeppassphrase, final PassPhraseAgent coreagent, final String serviceid) throws UserCancelsException {
if (!Utility.isEmpty(keeppassphrase)&&keeppassphrase.equals("1")&&coreagent instanceof InteractiveAgent)
return new AskAtStartupAgent((InteractiveAgent)coreagent,serviceid);
--- 57,61 ----
}
! private static final PassPhraseAgent createWrapperAgent(final String keeppassphrase, final PassPhraseAgent coreagent, final String serviceid) throws UserCancellationException {
if (!Utility.isEmpty(keeppassphrase)&&keeppassphrase.equals("1")&&coreagent instanceof InteractiveAgent)
return new AskAtStartupAgent((InteractiveAgent)coreagent,serviceid);
***************
*** 77,81 ****
if (!Utility.isEmpty(agenttype)){
if (agenttype.toLowerCase().equals("console"))
! return new CommandLineAgent();
if (agenttype.toLowerCase().equals("servlet"))
return new ServletPassPhraseAgent();
--- 77,81 ----
if (!Utility.isEmpty(agenttype)){
if (agenttype.toLowerCase().equals("console"))
! return new ConsoleAgent();
if (agenttype.toLowerCase().equals("servlet"))
return new ServletPassPhraseAgent();
Index: SimpleSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/SimpleSigner.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** SimpleSigner.java 18 Dec 2003 17:40:07 -0000 1.7
--- SimpleSigner.java 19 Dec 2003 00:31:15 -0000 1.8
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.8 2003/12/19 00:31:15 pelle
+ * Lots of usability changes through out all the passphrase agents and end user tools.
+ *
* Revision 1.7 2003/12/18 17:40:07 pelle
* You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
***************
*** 12,16 ****
* The screen has also been cleaned up and displays the xml to be signed.
* The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! * The PassPhraseAgent's now have a UserCancelsException, which allows the agent to tell the application if the user specifically
* cancels the signing process.
*
--- 15,19 ----
* The screen has also been cleaned up and displays the xml to be signed.
* The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! * The PassPhraseAgent's now have a UserCancellationException, which allows the agent to tell the application if the user specifically
* cancels the signing process.
*
Index: TestCaseSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/TestCaseSigner.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TestCaseSigner.java 14 Dec 2003 20:52:54 -0000 1.8
--- TestCaseSigner.java 19 Dec 2003 00:31:16 -0000 1.9
***************
*** 2,5 ****
--- 2,6 ----
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.LowLevelException;
import org.neuclear.commons.crypto.passphraseagents.AlwaysTheSamePassphraseAgent;
import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent;
***************
*** 29,32 ****
--- 30,36 ----
$Id$
$Log$
+ Revision 1.9 2003/12/19 00:31:16 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.8 2003/12/14 20:52:54 pelle
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
***************
*** 83,95 ****
* <tt>src/testdata/keys/testkeys.jks</tt><br>
* The password for all keys should be "neuclear"
- *
- * @throws NeuClearException
- * @throws GeneralSecurityException
*/
! public TestCaseSigner() throws NeuClearException, GeneralSecurityException {
! this(KEYSTORE, getKeyStore(), "neuclear");
}
! public TestCaseSigner(final PassPhraseAgent agent) throws GeneralSecurityException, NeuClearException {
this(KEYSTORE, getKeyStore(), agent);
}
--- 87,96 ----
* <tt>src/testdata/keys/testkeys.jks</tt><br>
* The password for all keys should be "neuclear"
*/
! public TestCaseSigner() throws InvalidPassphraseException {
! this(KEYSTORE, getKeyStore(), "neuclear");
}
! public TestCaseSigner(final PassPhraseAgent agent) throws InvalidPassphraseException {
this(KEYSTORE, getKeyStore(), agent);
}
***************
*** 102,113 ****
* @param in InputStream
* @param passphrase The passphrase to use
! * @throws NeuClearException
! * @throws GeneralSecurityException
*/
! public TestCaseSigner(final String name, final InputStream in, final String passphrase) throws NeuClearException, GeneralSecurityException {
this(name, in, new AlwaysTheSamePassphraseAgent(passphrase));
}
! public TestCaseSigner(final String name, final InputStream in, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
super(name,
in,
--- 103,113 ----
* @param in InputStream
* @param passphrase The passphrase to use
! * @throws InvalidPassphraseException
*/
! public TestCaseSigner(final String name, final InputStream in, final String passphrase) throws InvalidPassphraseException {
this(name, in, new AlwaysTheSamePassphraseAgent(passphrase));
}
! public TestCaseSigner(final String name, final InputStream in, final PassPhraseAgent agent) throws InvalidPassphraseException {
super(name,
in,
|
|
From: <pe...@us...> - 2003-12-19 00:31:19
|
Update of /cvsroot/neuclear/neuclear-commons In directory sc8-pr-cvs1:/tmp/cvs-serv18953 Modified Files: project.properties Log Message: Lots of usability changes through out all the passphrase agents and end user tools. Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/project.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** project.properties 11 Dec 2003 23:56:28 -0000 1.11 --- project.properties 19 Dec 2003 00:31:16 -0000 1.12 *************** *** 22,24 **** maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ #maven.test.skip=true ! maven.uberjar.main = org.neuclear.commons.crypto.passphraseagents.CommandLineAgent --- 22,24 ---- maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ #maven.test.skip=true ! maven.uberjar.main = org.neuclear.commons.crypto.passphraseagents.ConsoleAgent |
|
From: <pe...@us...> - 2003-12-19 00:31:19
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons
In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons
Modified Files:
LowLevelException.java Utility.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: LowLevelException.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/LowLevelException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LowLevelException.java 11 Dec 2003 23:56:28 -0000 1.1
--- LowLevelException.java 19 Dec 2003 00:31:16 -0000 1.2
***************
*** 21,24 ****
--- 21,27 ----
$Id$
$Log$
+ Revision 1.2 2003/12/19 00:31:16 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.1 2003/12/11 23:56:28 pelle
Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
***************
*** 33,38 ****
*/
public class LowLevelException extends RuntimeException {
! public LowLevelException(Throwable throwable) {
! super("LowLevelException in a sub system of NeuClear", throwable);
}
}
--- 36,41 ----
*/
public class LowLevelException extends RuntimeException {
! public LowLevelException(Throwable e) {
! super("LowLevelException in a sub system of NeuClear:\n"+e.getLocalizedMessage(), e);
}
}
Index: Utility.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/Utility.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Utility.java 18 Dec 2003 17:40:07 -0000 1.3
--- Utility.java 19 Dec 2003 00:31:16 -0000 1.4
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/12/19 00:31:16 pelle
+ * Lots of usability changes through out all the passphrase agents and end user tools.
+ *
* Revision 1.3 2003/12/18 17:40:07 pelle
* You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
***************
*** 136,139 ****
--- 139,144 ----
import java.io.InputStreamReader;
import java.io.IOException;
+ import java.util.regex.Pattern;
+ import java.util.regex.Matcher;
public final class Utility {
***************
*** 221,224 ****
--- 226,248 ----
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
return reader.readLine();
+ }
+
+ public static String getExecutable(Class reference){
+ Pattern p=Pattern.compile("\\.");
+ Matcher m=p.matcher(reference.getName());
+ String classfile=m.replaceAll("/")+".class";
+ String url=reference.getClassLoader().getResource(classfile).toExternalForm();
+ if (url.startsWith("jar:")) {
+ Pattern r2=Pattern.compile(":([^:]*\\.jar)!");
+ Matcher m2=r2.matcher(url);
+ if(m2.matches()){
+ String path=m2.group(1);
+ String cd=System.getProperty("user.dir");
+ if (path.startsWith(cd))
+ return "$ java -jar "+path.substring(cd.length());
+ return "$ java -jar "+path;
+ }
+ }
+ return "$ java "+reference.getName();
}
|
|
From: <pe...@us...> - 2003-12-19 00:31:19
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/time
In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons/time
Modified Files:
TimeTools.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: TimeTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/time/TimeTools.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TimeTools.java 21 Nov 2003 04:43:42 -0000 1.3
--- TimeTools.java 19 Dec 2003 00:31:16 -0000 1.4
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/12/19 00:31:16 pelle
+ * Lots of usability changes through out all the passphrase agents and end user tools.
+ *
* Revision 1.3 2003/11/21 04:43:42 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 119,123 ****
return DF;
}
!
/**
* Base ISO 8601 Date format yyyy-MM-ddTHH:mm:ss,SSSzzz i.e., 2002-12-25T14:32:12,333-500 for
--- 122,130 ----
return DF;
}
! public static Date get2020(){
! Calendar calendar=Calendar.getInstance();
! calendar.set(2020,0,0,0,0,0);
! return calendar.getTime();
! }
/**
* Base ISO 8601 Date format yyyy-MM-ddTHH:mm:ss,SSSzzz i.e., 2002-12-25T14:32:12,333-500 for
|
|
From: <pe...@us...> - 2003-12-19 00:31:19
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons/crypto/passphraseagents
Modified Files:
AskAtStartupAgent.java GuiDialogAgent.java
InteractiveAgent.java PassPhraseAgent.java
ServletPassPhraseAgent.java
Added Files:
ConsoleAgent.java
Removed Files:
CommandLineAgent.java UserCancelsException.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
--- NEW FILE: ConsoleAgent.java ---
package org.neuclear.commons.crypto.passphraseagents;
import org.neuclear.commons.Utility;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.HashMap;
/*
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: ConsoleAgent.java,v 1.1 2003/12/19 00:31:15 pelle Exp $
$Log: ConsoleAgent.java,v $
Revision 1.1 2003/12/19 00:31:15 pelle
Lots of usability changes through out all the passphrase agents and end user tools.
Revision 1.4 2003/12/16 23:16:40 pelle
Work done on the SigningServlet. The two phase web model is now only an option.
Allowing much quicker signing, using the GuiDialogueAgent.
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
The PassPhraseAgent's now have a UserCancellationException, which allows the agent to tell the application if the user specifically
cancels the signing process.
Revision 1.3 2003/11/21 04:43:41 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Revision 1.2 2003/11/19 14:37:37 pelle
ConsoleAgent now masks the passphrase input using the JLine library which is now a dependency.
And the beginnings of a KeyGeneratorApplet
Revision 1.1 2003/11/11 21:17:46 pelle
Further vital reshuffling.
org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
Did a bit of work on the Canonicalizer and changed a few other minor bits.
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: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 final class ConsoleAgent implements InteractiveAgent {
public ConsoleAgent() {
this.cache = new HashMap();
}
public char[] getPassPhrase(String name) throws UserCancellationException {
return getPassPhrase(name,false); //To change body of implemented methods use Options | File Templates.
}
public final synchronized char[] getPassPhrase(final String name, boolean incorrect) throws UserCancellationException {
if (!incorrect&&cache.containsKey(name))
return ((String)cache.get(name)).toCharArray();
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
if (incorrect)
System.out.println("entered passphrase was incorrect please try again");
System.out.println("Please enter passphrase for: " + name+" ('q' to quit)");
System.out.print(": ");
try {
final String line = new jline.ConsoleReader().readLine(new Character((char)'*'));
if (line.equals("q"))
throw new UserCancellationException(name);
if (firstrun) {
System.out.println("Do you wish to remember your entered passphrases for this sesson?");
if(Utility.getAffirmative(false)) {
remember=true;
}
firstrun=false;
}
if (remember)
cache.put(name,line);
return line.toCharArray();
} catch (IOException e) {
System.err.println("Couldnt read line. Returning empty passphrase");
return "".toCharArray();
}
}
private final Map cache;
private boolean remember=false;
private boolean firstrun=true;
public static void main(final String[] args) {
final InteractiveAgent dia = new ConsoleAgent();
try {
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test",true)));
} catch (UserCancellationException e) {
System.out.println("user cancelled");
}
System.exit(0);
}
}
Index: AskAtStartupAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/AskAtStartupAgent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AskAtStartupAgent.java 16 Dec 2003 23:16:40 -0000 1.3
--- AskAtStartupAgent.java 19 Dec 2003 00:31:15 -0000 1.4
***************
*** 21,24 ****
--- 21,27 ----
$Id$
$Log$
+ Revision 1.4 2003/12/19 00:31:15 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.3 2003/12/16 23:16:40 pelle
Work done on the SigningServlet. The two phase web model is now only an option.
***************
*** 26,30 ****
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancelsException, which allows the agent to tell the application if the user specifically
cancels the signing process.
--- 29,33 ----
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancellationException, which allows the agent to tell the application if the user specifically
cancels the signing process.
***************
*** 49,53 ****
*/
public final class AskAtStartupAgent implements PassPhraseAgent {
! public AskAtStartupAgent(final InteractiveAgent agent, final String name) throws UserCancelsException {
this.name = name;
this.passphrase = agent.getPassPhrase(name);
--- 52,56 ----
*/
public final class AskAtStartupAgent implements PassPhraseAgent {
! public AskAtStartupAgent(final InteractiveAgent agent, final String name) throws UserCancellationException {
this.name = name;
this.passphrase = agent.getPassPhrase(name);
Index: GuiDialogAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/GuiDialogAgent.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GuiDialogAgent.java 16 Dec 2003 23:16:40 -0000 1.4
--- GuiDialogAgent.java 19 Dec 2003 00:31:15 -0000 1.5
***************
*** 29,32 ****
--- 29,35 ----
$Id$
$Log$
+ Revision 1.5 2003/12/19 00:31:15 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.4 2003/12/16 23:16:40 pelle
Work done on the SigningServlet. The two phase web model is now only an option.
***************
*** 34,38 ****
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancelsException, which allows the agent to tell the application if the user specifically
cancels the signing process.
--- 37,41 ----
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancellationException, which allows the agent to tell the application if the user specifically
cancels the signing process.
***************
*** 117,122 ****
nameLabel = new Label();
nameLabel.setForeground(Color.blue);
-
text.add(nameLabel);
passphrase = new TextField();
passphrase.setEchoChar('*');
--- 120,128 ----
nameLabel = new Label();
nameLabel.setForeground(Color.blue);
text.add(nameLabel);
+ incorrectLabel = new Label();
+ incorrectLabel.setForeground(Color.red);
+ incorrectLabel.setVisible(false);
+ text.add(incorrectLabel);
passphrase = new TextField();
passphrase.setEchoChar('*');
***************
*** 163,167 ****
}
! public synchronized char[] getPassPhrase(final String name) throws UserCancelsException {
synchronized (passphrase) {//We dont want multiple agents popping up at the same time
if (cache.containsKey(name))
--- 169,183 ----
}
! public char[] getPassPhrase(final String name) throws UserCancellationException {
! return getPassPhrase(name,false);
! }
! /**
! * Asks for the passphrase.
! * @param name
! * @param incorrect true indicates the user entered an incorrect passphrase and should reenter it.
! * @return
! * @throws UserCancellationException
! */
! public synchronized char[] getPassPhrase(final String name,boolean incorrect) throws UserCancellationException {
synchronized (passphrase) {//We dont want multiple agents popping up at the same time
if (cache.containsKey(name))
***************
*** 170,173 ****
--- 186,191 ----
passphrase.setText("");
isCancel=true;
+ incorrectLabel.setVisible(true);
+
nameLabel.setText(name);
frame.pack();
***************
*** 180,184 ****
frame.setVisible(false);
if(isCancel)
! throw new UserCancelsException(name);
final String phrase = passphrase.getText();
if(remember.getState())
--- 198,202 ----
frame.setVisible(false);
if(isCancel)
! throw new UserCancellationException(name);
final String phrase = passphrase.getText();
if(remember.getState())
***************
*** 190,198 ****
public static void main(final String[] args) {
! final PassPhraseAgent dia = new GuiDialogAgent();
try {
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
! System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
! } catch (UserCancelsException e) {
System.out.print("User Cancellation by: "+e.getName());
}
--- 208,216 ----
public static void main(final String[] args) {
! final InteractiveAgent dia = new GuiDialogAgent();
try {
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
! System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test",true)));
! } catch (UserCancellationException e) {
System.out.print("User Cancellation by: "+e.getName());
}
***************
*** 205,208 ****
--- 223,227 ----
private final Checkbox remember;
private final Label nameLabel;
+ private final Label incorrectLabel;
private final Frame frame;
private final Map cache;
Index: InteractiveAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/InteractiveAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** InteractiveAgent.java 11 Nov 2003 21:17:46 -0000 1.1
--- InteractiveAgent.java 19 Dec 2003 00:31:15 -0000 1.2
***************
*** 21,24 ****
--- 21,27 ----
$Id$
$Log$
+ Revision 1.2 2003/12/19 00:31:15 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.1 2003/11/11 21:17:46 pelle
Further vital reshuffling.
***************
*** 39,41 ****
--- 42,46 ----
*/
public interface InteractiveAgent extends PassPhraseAgent {
+ char[] getPassPhrase(String name,boolean incorrect) throws UserCancellationException;
+
}
Index: PassPhraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/PassPhraseAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PassPhraseAgent.java 16 Dec 2003 23:16:40 -0000 1.2
--- PassPhraseAgent.java 19 Dec 2003 00:31:15 -0000 1.3
***************
*** 22,25 ****
--- 22,28 ----
$Id$
$Log$
+ Revision 1.3 2003/12/19 00:31:15 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.2 2003/12/16 23:16:40 pelle
Work done on the SigningServlet. The two phase web model is now only an option.
***************
*** 27,31 ****
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancelsException, which allows the agent to tell the application if the user specifically
cancels the signing process.
--- 30,34 ----
The screen has also been cleaned up and displays the xml to be signed.
The GuiDialogueAgent now optionally remembers passphrases and has a checkbox to support this.
! The PassPhraseAgent's now have a UserCancellationException, which allows the agent to tell the application if the user specifically
cancels the signing process.
***************
*** 63,66 ****
* @return
*/
! char[] getPassPhrase(String name) throws UserCancelsException;
}
--- 66,69 ----
* @return
*/
! char[] getPassPhrase(String name) throws UserCancellationException;
}
Index: ServletPassPhraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/ServletPassPhraseAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ServletPassPhraseAgent.java 14 Dec 2003 20:52:54 -0000 1.1
--- ServletPassPhraseAgent.java 19 Dec 2003 00:31:15 -0000 1.2
***************
*** 41,43 ****
--- 41,47 ----
set(null);
}
+
+ public char[] getPassPhrase(String name, boolean incorrect) throws UserCancellationException {
+ return getPassPhrase(name);
+ }
}
--- CommandLineAgent.java DELETED ---
--- UserCancelsException.java DELETED ---
|
|
From: <pe...@us...> - 2003-12-19 00:31:19
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto
In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons/crypto
Modified Files:
CryptoTools.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: CryptoTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CryptoTools.java 18 Dec 2003 17:40:07 -0000 1.8
--- CryptoTools.java 19 Dec 2003 00:31:16 -0000 1.9
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.9 2003/12/19 00:31:16 pelle
+ * Lots of usability changes through out all the passphrase agents and end user tools.
+ *
* Revision 1.8 2003/12/18 17:40:07 pelle
* You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
***************
*** 224,227 ****
--- 227,231 ----
import org.bouncycastle.jce.X509Principal;
import org.bouncycastle.asn1.x509.X509Name;
+ import org.neuclear.commons.time.TimeTools;
import javax.crypto.Cipher;
***************
*** 251,254 ****
--- 255,260 ----
public final class CryptoTools {
+
+
/**
* Call this method at the beginning of an executable. To ensure that BouncyCastle gets installed properly.
***************
*** 785,788 ****
--- 791,795 ----
gen.setPublicKey(kp.getPublic());
gen.setNotBefore(new Date());
+ gen.setNotAfter(TimeTools.get2020());
gen.setSignatureAlgorithm("SHA1withRSA");
gen.setSerialNumber(new BigInteger( digest(kp.getPublic().getEncoded())));
***************
*** 806,809 ****
public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.neuclear/keystore.jks";
public static final int RAND_BIT_LENGTH = 128;
!
}
--- 813,816 ----
public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.neuclear/keystore.jks";
public static final int RAND_BIT_LENGTH = 128;
! private static final long YPLUS20 = 20*365*24*60*60;
}
|
|
From: <pe...@us...> - 2003-12-19 00:31:18
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets In directory sc8-pr-cvs1:/tmp/cvs-serv18953/src/java/org/neuclear/commons/crypto/applets Modified Files: KeyGenerationTask.java KeyGeneratorApplet.java Log Message: Lots of usability changes through out all the passphrase agents and end user tools. Index: KeyGenerationTask.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets/KeyGenerationTask.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeyGenerationTask.java 21 Nov 2003 04:43:40 -0000 1.2 --- KeyGenerationTask.java 19 Dec 2003 00:31:15 -0000 1.3 *************** *** 11,14 **** --- 11,17 ---- * $Id$ * $Log$ + * Revision 1.3 2003/12/19 00:31:15 pelle + * Lots of usability changes through out all the passphrase agents and end user tools. + * * Revision 1.2 2003/11/21 04:43:40 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 18,22 **** * * Revision 1.1 2003/11/19 14:37:37 pelle ! * CommandLineAgent now masks the passphrase input using the JLine library which is now a dependency. * And the beginnings of a KeyGeneratorApplet * --- 21,25 ---- * * Revision 1.1 2003/11/19 14:37:37 pelle ! * ConsoleAgent now masks the passphrase input using the JLine library which is now a dependency. * And the beginnings of a KeyGeneratorApplet * Index: KeyGeneratorApplet.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets/KeyGeneratorApplet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeyGeneratorApplet.java 21 Nov 2003 04:43:40 -0000 1.2 --- KeyGeneratorApplet.java 19 Dec 2003 00:31:15 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * $Id$ * $Log$ + * Revision 1.3 2003/12/19 00:31:15 pelle + * Lots of usability changes through out all the passphrase agents and end user tools. + * * Revision 1.2 2003/11/21 04:43:40 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 27,31 **** * * Revision 1.1 2003/11/19 14:37:37 pelle ! * CommandLineAgent now masks the passphrase input using the JLine library which is now a dependency. * And the beginnings of a KeyGeneratorApplet * --- 30,34 ---- * * Revision 1.1 2003/11/19 14:37:37 pelle ! * ConsoleAgent now masks the passphrase input using the JLine library which is now a dependency. * And the beginnings of a KeyGeneratorApplet * |
|
From: <pe...@us...> - 2003-12-19 00:30:58
|
Update of /cvsroot/neuclear/neuclear-signer
In directory sc8-pr-cvs1:/tmp/cvs-serv18910
Modified Files:
project.xml
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: project.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-signer/project.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** project.xml 16 Dec 2003 15:39:01 -0000 1.3
--- project.xml 19 Dec 2003 00:30:55 -0000 1.4
***************
*** 120,123 ****
--- 120,132 ----
</properties>
</dependency>
+ <dependency>
+ <id>jline</id>
+ <version>0.8.1</version>
+ </dependency>
+ <dependency>
+ <id>commons-cli</id>
+ <name>commons-cli</name>
+ <version>1.0-beta-2</version>
+ </dependency>
</dependencies>
<build>
|
|
From: <pe...@us...> - 2003-12-19 00:30:58
|
Update of /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone
In directory sc8-pr-cvs1:/tmp/cvs-serv18910/src/java/org/neuclear/signers/standalone
Modified Files:
StandaloneSigner.java StandaloneSigningServlet.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: StandaloneSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone/StandaloneSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** StandaloneSigner.java 16 Dec 2003 23:16:15 -0000 1.3
--- StandaloneSigner.java 19 Dec 2003 00:30:55 -0000 1.4
***************
*** 8,13 ****
--- 8,16 ----
import org.mortbay.util.InetAddrPort;
import org.mortbay.util.MultiException;
+ import org.neuclear.commons.crypto.CryptoTools;
+ import org.neuclear.id.tools.commandline.IdentityCreator;
import java.io.IOException;
+ import java.io.File;
***************
*** 20,38 ****
public class StandaloneSigner {
public static void main(String args[]){
! try {
! Server server = new Server();
! server.addListener(new InetAddrPort("127.0.0.1",11870));
! HttpContext context = server.getContext("/");
! ServletHandler handler= new ServletHandler();
! handler.addServlet("/Signer","org.neuclear.signers.standalone.StandaloneSigningServlet");
! context.addHandler(handler);
! server.start();
! context.start();
! handler.start();
! handler.initializeServlets();
! } catch (Exception e) {
! e.printStackTrace(); //To change body of catch statement use Options | File Templates.
}
-
}
}
--- 23,50 ----
public class StandaloneSigner {
public static void main(String args[]){
! if (args.length>0) {
! IdentityCreator.main(args);
! return;
! }
! File keystore=new File(CryptoTools.DEFAULT_KEYSTORE);
! if (!keystore.exists()) {
! System.out.println("First you need to create an Identity. Use this tool with the following options.\n For more help go to http://neuclear.org/signer/bdg.html");
! IdentityCreator.main(args);
! } else {
! try {
! Server server = new Server();
! server.addListener(new InetAddrPort("127.0.0.1",11870));
! HttpContext context = server.getContext("/");
! ServletHandler handler= new ServletHandler();
! handler.addServlet("/Signer","org.neuclear.signers.standalone.StandaloneSigningServlet");
! context.addHandler(handler);
! server.start();
! context.start();
! handler.start();
! handler.initializeServlets();
! } catch (Exception e) {
! e.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
}
}
Index: StandaloneSigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone/StandaloneSigningServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StandaloneSigningServlet.java 16 Dec 2003 23:16:15 -0000 1.2
--- StandaloneSigningServlet.java 19 Dec 2003 00:30:55 -0000 1.3
***************
*** 4,8 ****
--- 4,12 ----
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.DefaultSigner;
+ import org.neuclear.commons.crypto.signers.InvalidPassphraseException;
import org.neuclear.commons.crypto.passphraseagents.GuiDialogAgent;
+ import org.neuclear.commons.crypto.passphraseagents.InteractiveAgent;
+ import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
+ import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
***************
*** 27,32 ****
*/
public class StandaloneSigningServlet extends SigningServlet {
! protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException, IOException {
! return new DefaultSigner(new GuiDialogAgent());
}
--- 31,44 ----
*/
public class StandaloneSigningServlet extends SigningServlet {
! public StandaloneSigningServlet() {
! this.agent = new GuiDialogAgent();
! }
!
! protected Signer createSigner(ServletConfig config) throws CryptoException {
! try {
! return new DefaultSigner(agent);
! } catch (InvalidPassphraseException e) {
! return createSigner(config);
! }
}
***************
*** 35,39 ****
}
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
! if(!request.getRemoteAddr().equals("127.0.0.1"))
((HttpServletResponse)response).sendError(500,"No external access allowed");
super.service(request, response);
--- 47,51 ----
}
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
! if(!request.getRemoteAddr().equals("127.0.0.2"))
((HttpServletResponse)response).sendError(500,"No external access allowed");
super.service(request, response);
***************
*** 46,48 ****
--- 58,62 ----
}
+ private final InteractiveAgent agent;
+
}
|
|
From: <pe...@us...> - 2003-12-19 00:30:52
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv18876/src/java/org/neuclear/asset/contracts/builders
Modified Files:
AssetBuilder.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: AssetBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders/AssetBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AssetBuilder.java 21 Nov 2003 04:43:03 -0000 1.4
--- AssetBuilder.java 19 Dec 2003 00:30:49 -0000 1.5
***************
*** 36,39 ****
--- 36,42 ----
$Id$
$Log$
+ Revision 1.5 2003/12/19 00:30:49 pelle
+ Lots of usability changes through out all the passphrase agents and end user tools.
+
Revision 1.4 2003/11/21 04:43:03 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 133,141 ****
final Store store = new FileStore("target/testdata/repository");
store.receive(asset);
! } catch (GeneralSecurityException e) {
! e.printStackTrace();
! } catch (NeuClearException e) {
! e.printStackTrace();
! } catch (XMLException e) {
e.printStackTrace();
}
--- 136,140 ----
final Store store = new FileStore("target/testdata/repository");
store.receive(asset);
! } catch (Exception e) {
e.printStackTrace();
}
|
|
From: <pe...@us...> - 2003-12-18 17:40:35
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv29659/src/java/org/neuclear/id/builders
Modified Files:
IdentityBuilder.java NamedObjectBuilder.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: IdentityBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/IdentityBuilder.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** IdentityBuilder.java 16 Dec 2003 15:04:59 -0000 1.14
--- IdentityBuilder.java 18 Dec 2003 17:40:19 -0000 1.15
***************
*** 2,5 ****
--- 2,10 ----
* $Id$
* $Log$
+ * Revision 1.15 2003/12/18 17:40:19 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.14 2003/12/16 15:04:59 pelle
* Added SignedMessage contract for signing simple textual contracts.
***************
*** 203,214 ****
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
import org.neuclear.id.NSTools;
import org.neuclear.xml.xmlsec.XMLSecTools;
import org.neuclear.xml.xmlsec.XMLSecurityException;
import java.security.PublicKey;
public class IdentityBuilder extends NamedObjectBuilder {
-
/**
* It creates a Standard Identity document, but doesn't sign it.
--- 208,223 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
+ import org.neuclear.commons.crypto.signers.Signer;
+ import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.id.NSTools;
+ import org.neuclear.id.Identity;
import org.neuclear.xml.xmlsec.XMLSecTools;
import org.neuclear.xml.xmlsec.XMLSecurityException;
+ import org.neuclear.xml.XMLException;
import java.security.PublicKey;
+ import java.security.cert.Certificate;
public class IdentityBuilder extends NamedObjectBuilder {
/**
* It creates a Standard Identity document, but doesn't sign it.
***************
*** 223,227 ****
public IdentityBuilder(final String name, final PublicKey allow, final String repository, final String signer, final String logger, final String receiver) throws NeuClearException {
this(createNEUIDQName(TAGNAME), name, allow, repository, signer, logger, receiver);
-
}
--- 232,235 ----
***************
*** 250,261 ****
createNEUIDAttribute("receiver", receiver);
! if (allow != null) {
! final QName allowName = DocumentHelper.createQName("allow", NSTools.NS_NEUID);
! final Element pub = root.addElement(allowName);
! pub.addText("\n");
! pub.add(XMLSecTools.createKeyInfo(allow));
! }
}
public IdentityBuilder(final String name, final PublicKey allow, final String repository) throws XMLSecurityException, NeuClearException {
this(name, allow, repository, null, null, null);
--- 258,265 ----
createNEUIDAttribute("receiver", receiver);
! setPublicKey(allow);
}
+
public IdentityBuilder(final String name, final PublicKey allow, final String repository) throws XMLSecurityException, NeuClearException {
this(name, allow, repository, null, null, null);
***************
*** 265,271 ****
--- 269,288 ----
this(name, allow, null);
}
+ private void setPublicKey(final PublicKey allow) {
+ if (allow != null) {
+ final QName allowName = DocumentHelper.createQName("allow", NSTools.NS_NEUID);
+ Element pub=getElement().element(allowName);
+ if (pub==null)
+ pub = getElement().addElement(allowName);
+ else
+ pub.clearContent();
+ pub.addText("\n");
+ pub.add(XMLSecTools.createKeyInfo(allow));
+ }
+ }
private static final String TAGNAME = "Identity";
+
Index: NamedObjectBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/NamedObjectBuilder.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** NamedObjectBuilder.java 11 Dec 2003 23:57:29 -0000 1.18
--- NamedObjectBuilder.java 18 Dec 2003 17:40:19 -0000 1.19
***************
*** 2,5 ****
--- 2,10 ----
* $Id$
* $Log$
+ * Revision 1.19 2003/12/18 17:40:19 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.18 2003/12/11 23:57:29 pelle
* Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
***************
*** 263,267 ****
}
! private SignedNamedObject convert() throws NeuClearException, XMLException {
return VerifyingReader.getInstance().read(getElement());
--- 268,272 ----
}
! final public SignedNamedObject convert() throws NeuClearException, XMLException {
return VerifyingReader.getInstance().read(getElement());
|
|
From: <pe...@us...> - 2003-12-18 17:40:35
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline
In directory sc8-pr-cvs1:/tmp/cvs-serv29659/src/java/org/neuclear/id/tools/commandline
Modified Files:
CommandLineSigner.java IdentityCreator.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: CommandLineSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline/CommandLineSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CommandLineSigner.java 12 Dec 2003 00:13:11 -0000 1.3
--- CommandLineSigner.java 18 Dec 2003 17:40:19 -0000 1.4
***************
*** 1,4 ****
--- 1,9 ----
/* $Id$
* $Log$
+ * Revision 1.4 2003/12/18 17:40:19 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.3 2003/12/12 00:13:11 pelle
* This may actually work now. Need to put a few more test cases in to make sure.
***************
*** 284,288 ****
of = subject.getLocalName() + ".xml";
System.err.println("Key with alias: " + alias + " doesnt exist in our keystore. \nSaving unsigned Identity as: " + of);
! } else {
System.err.println("Signing by " + alias + " ...");
subject.sign(alias, sig);
--- 289,293 ----
of = subject.getLocalName() + ".xml";
System.err.println("Key with alias: " + alias + " doesnt exist in our keystore. \nSaving unsigned Identity as: " + of);
! } else if(!subject.isSigned()) {
System.err.println("Signing by " + alias + " ...");
subject.sign(alias, sig);
Index: IdentityCreator.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline/IdentityCreator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IdentityCreator.java 11 Dec 2003 16:16:14 -0000 1.3
--- IdentityCreator.java 18 Dec 2003 17:40:19 -0000 1.4
***************
*** 1,4 ****
--- 1,9 ----
/* $Id$
* $Log$
+ * Revision 1.4 2003/12/18 17:40:19 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.3 2003/12/11 16:16:14 pelle
* Some changes to make the xml a bit more readable.
***************
*** 243,251 ****
final String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER);
final 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);
-
}
--- 248,268 ----
final String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER);
final String defaultreceiver = cmd.getOptionValue("b");
+ if (!sig.canSignFor(allow)){
+ System.out.println("You do not currently have a key matching this name. Do you with to create one?");
+ if (!Utility.getAffirmative(true)) {
+ System.out.println("OK, Bye");
+ System.exit(0);
+ }
+ System.out.print("Generating Keys for "+allow+"... ");
+ PublicKey pub=sig.generateKey(allow);
+ System.out.println("DONE");
+ System.out.println("STORING Keys");
+ sig.save();
+
+ }
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);
}
|
|
From: <pe...@us...> - 2003-12-18 17:40:22
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/jce
In directory sc8-pr-cvs1:/tmp/cvs-serv29659/src/test/org/neuclear/id/jce
Modified Files:
NeuClearJCETest.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: NeuClearJCETest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/jce/NeuClearJCETest.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** NeuClearJCETest.java 17 Dec 2003 18:02:44 -0000 1.8
--- NeuClearJCETest.java 18 Dec 2003 17:40:19 -0000 1.9
***************
*** 4,8 ****
--- 4,11 ----
import org.neuclear.commons.crypto.passphraseagents.AlwaysTheSamePassphraseAgent;
import org.neuclear.commons.crypto.signers.JCESigner;
+ import org.neuclear.commons.crypto.CryptoException;
+ import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.id.Identity;
+ import org.neuclear.id.InvalidNamedObjectException;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
import org.neuclear.id.builders.IdentityBuilder;
***************
*** 39,42 ****
--- 42,50 ----
$Id$
$Log$
+ Revision 1.9 2003/12/18 17:40:19 pelle
+ You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ IdentityCreator has been modified to allow creation of keys.
+ Note The actual Creation of Certificates still have a problem that will be resolved later today.
+
Revision 1.8 2003/12/17 18:02:44 pelle
NeuClear JCE Certificates now work with KeyStore.
***************
*** 90,93 ****
--- 98,103 ----
*/
public final class NeuClearJCETest extends AbstractSigningTest {
+ static final String IVAN = "neu://ivan@test";
+
public NeuClearJCETest(final String string) throws NeuClearException, GeneralSecurityException {
super(string);
***************
*** 180,183 ****
--- 190,216 ----
//authb.sign(sig2);
+ }
+ public void testCreateAndUpdateCert() throws NeuClearException, XMLException {
+ PublicKey pub=getSigner().generateKey(IVAN);
+ assertNotNull(pub);
+ final IdentityBuilder id = new IdentityBuilder(IVAN,pub);
+ assertEquals(IVAN,id.getName());
+ assertTrue(signer.canSignFor(IVAN));
+ assertNotNull(signer.getPublicKey(IVAN));
+ assertEquals(pub,signer.getPublicKey(IVAN));
+ try {
+ final Identity ivan = (Identity) id.convert();
+ assertNotNull(ivan);
+ assertEquals(IVAN,ivan.getName());
+ assertNotNull(ivan.getPublicKey());
+ assertEquals(pub,ivan.getCertificate().getPublicKey());
+ assertEquals(ivan.getPublicKey(),signer.getPublicKey(IVAN));
+ final byte[] data = "this is a test".getBytes();
+ final byte[] sig = signer.sign(IVAN, data);
+ assertNotNull(sig);
+ assertTrue(CryptoTools.verify(ivan.getPublicKey(), data, sig));
+ } catch (InvalidNamedObjectException e) {
+ assertTrue("The Signature was invalid",false);
+ }
}
}
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/test/org/neuclear/commons/crypto/signers
Modified Files:
SimpleSignerStoreTest.java TestCaseSignerTest.java
Added Files:
JCESignerTest.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
--- NEW FILE: JCESignerTest.java ---
package org.neuclear.commons.crypto.signers;
import junit.framework.TestCase;
import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.commons.crypto.passphraseagents.AlwaysTheSamePassphraseAgent;
import org.neuclear.commons.NeuClearException;
import java.io.FileNotFoundException;
import java.io.File;
import java.security.GeneralSecurityException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 18, 2003
* Time: 11:55:07 AM
* To change this template use Options | File Templates.
*/
public class JCESignerTest extends TestCase{
static final String FILENAME = "target/testdata/keystores/jcesignertest.jks";
static final String BOB="neu://bob@test";
static final String ALICE="neu://alice@test";
public JCESignerTest(String string) {
super(string);
CryptoTools.ensureProvider();
}
public void testCreateBlank() throws FileNotFoundException, GeneralSecurityException, NeuClearException {
File file=new File(FILENAME);
if (file.exists())
file.delete();// We want to clear out any existing stores
assertFalse(file.exists());
JCESigner signer=new JCESigner(FILENAME,"jks","SUN",new AlwaysTheSamePassphraseAgent("neuclear"));
assertFalse(signer.canSignFor(BOB));
assertFalse(signer.canSignFor(ALICE));
signer.generateKey(BOB);
signer.generateKey(ALICE);
assertTrue(signer.canSignFor(BOB));
assertTrue(signer.canSignFor(ALICE));
signer.save();
assertTrue(file.exists());
JCESigner signer2=new JCESigner(FILENAME,"jks","SUN",new AlwaysTheSamePassphraseAgent("neuclear"));
assertTrue(signer2.canSignFor(BOB));
assertTrue(signer2.canSignFor(ALICE));
}
}
Index: SimpleSignerStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/SimpleSignerStoreTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SimpleSignerStoreTest.java 10 Dec 2003 23:55:45 -0000 1.5
--- SimpleSignerStoreTest.java 18 Dec 2003 17:40:08 -0000 1.6
***************
*** 1,4 ****
--- 1,9 ----
/* $Id$
* $Log$
+ * Revision 1.6 2003/12/18 17:40:08 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.5 2003/12/10 23:55:45 pelle
* Did some cleaning up in the builders
Index: TestCaseSignerTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/TestCaseSignerTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestCaseSignerTest.java 10 Dec 2003 23:55:45 -0000 1.4
--- TestCaseSignerTest.java 18 Dec 2003 17:40:08 -0000 1.5
***************
*** 29,32 ****
--- 29,37 ----
$Id$
$Log$
+ Revision 1.5 2003/12/18 17:40:08 pelle
+ You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ IdentityCreator has been modified to allow creation of keys.
+ Note The actual Creation of Certificates still have a problem that will be resolved later today.
+
Revision 1.4 2003/12/10 23:55:45 pelle
Did some cleaning up in the builders
***************
*** 89,96 ****
assertTrue(CryptoTools.verify(pub, data, sig));
assertTrue(signer.canSignFor(ALIASEVE));
-
-
}
-
private void testKey(final String name) throws CryptoException {
final byte[] sig = signer.sign(name, TESTDATA.getBytes());
--- 94,98 ----
|
|
From: <pe...@us...> - 2003-12-18 17:40:11
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons
In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/java/org/neuclear/commons
Modified Files:
Utility.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: Utility.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/Utility.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Utility.java 21 Nov 2003 04:43:42 -0000 1.2
--- Utility.java 18 Dec 2003 17:40:07 -0000 1.3
***************
*** 2,5 ****
--- 2,10 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/12/18 17:40:07 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.2 2003/11/21 04:43:42 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 128,131 ****
--- 133,139 ----
import java.io.PrintStream;
+ import java.io.BufferedReader;
+ import java.io.InputStreamReader;
+ import java.io.IOException;
public final class Utility {
***************
*** 193,196 ****
--- 201,224 ----
return i;
return def;
+ }
+ /**
+ * Asks the User Y/N on the Console
+ * @return
+ */
+ public static boolean getAffirmative(final boolean def) throws IOException {
+ final String prompt = def?"(yes)/no":"yes/(no)";
+ String line=prompt(prompt).toLowerCase();
+ if (isEmpty(line))
+ return def;
+ return (line.equals("y")||line.equals("yes"));
+ }
+
+ public static String prompt(String prompt) throws IOException {
+ System.out.print(prompt);
+ return readLine();
+ }
+ public static String readLine() throws IOException {
+ BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
+ return reader.readLine();
}
|
|
From: <pe...@us...> - 2003-12-18 17:40:11
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto
In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/java/org/neuclear/commons/crypto
Modified Files:
CryptoTools.java
Removed Files:
RawCertificate.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: CryptoTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** CryptoTools.java 10 Dec 2003 23:55:45 -0000 1.7
--- CryptoTools.java 18 Dec 2003 17:40:07 -0000 1.8
***************
*** 2,5 ****
--- 2,10 ----
* $Id$
* $Log$
+ * Revision 1.8 2003/12/18 17:40:07 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.7 2003/12/10 23:55:45 pelle
* Did some cleaning up in the builders
***************
*** 216,219 ****
--- 221,227 ----
import org.bouncycastle.jce.interfaces.ECPrivateKey;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
+ import org.bouncycastle.jce.X509V3CertificateGenerator;
+ import org.bouncycastle.jce.X509Principal;
+ import org.bouncycastle.asn1.x509.X509Name;
import javax.crypto.Cipher;
***************
*** 236,239 ****
--- 244,250 ----
import java.security.spec.X509EncodedKeySpec;
import java.util.Random;
+ import java.util.HashMap;
+ import java.util.Vector;
+ import java.util.Date;
// TODO Implement some code to automatically BC Provider if not installed
***************
*** 288,291 ****
--- 299,316 ----
return null;
}
+ public static PublicKey getPublicKeyFromBase64(final String b64) throws CryptoException {
+ try {
+ final byte[] barray = Base64.decode(b64);
+ final X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(barray);
+ final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+ return keyFactory.generatePublic(pubKeySpec);
+ } catch (NoSuchAlgorithmException e) {
+ rethrowException(e);
+ } catch (InvalidKeySpecException e) {
+ rethrowException(e);
+ }
+
+ return null;
+ }
public static String formatByteArrayAsHex(final byte[] barray) {
***************
*** 747,750 ****
--- 772,792 ----
}
+ public final static Certificate createCertificate(String name,KeyPair kp) throws SignatureException, InvalidKeyException {
+ X509V3CertificateGenerator gen=new X509V3CertificateGenerator();
+ // Vector code=new Vector(1);
+ // code.add(0,"CN");
+ // Vector names=new Vector(1);
+ // names.add(0,name);
+ // final X509Name x509Name = new X509Name(code,names);
+ // gen.setIssuerDN(x509Name);
+ final X509Principal x509 = new X509Principal("CN="+name+", OU=NEU, O=NEU, L=NEU, ST=NEU, C=PA");
+ gen.setSubjectDN(x509);
+ gen.setIssuerDN(x509);
+ gen.setPublicKey(kp.getPublic());
+ gen.setNotBefore(new Date());
+ gen.setSignatureAlgorithm("SHA1withRSA");
+ gen.setSerialNumber(new BigInteger( digest(kp.getPublic().getEncoded())));
+ return gen.generateX509Certificate(kp.getPrivate());
+ }
{
ensureProvider();
***************
*** 762,766 ****
private static SecureRandom randSource;
! public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.keystore";
public static final int RAND_BIT_LENGTH = 128;
--- 804,808 ----
private static SecureRandom randSource;
! public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.neuclear/keystore.jks";
public static final int RAND_BIT_LENGTH = 128;
--- RawCertificate.java DELETED ---
|
|
From: <pe...@us...> - 2003-12-18 17:40:11
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/java/org/neuclear/commons/crypto/signers Modified Files: JCESigner.java Signer.java SimpleSigner.java Log Message: You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well. IdentityCreator has been modified to allow creation of keys. Note The actual Creation of Certificates still have a problem that will be resolved later today. Index: JCESigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/JCESigner.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JCESigner.java 16 Dec 2003 21:09:22 -0000 1.11 --- JCESigner.java 18 Dec 2003 17:40:07 -0000 1.12 *************** *** 2,5 **** --- 2,10 ---- * $Id$ * $Log$ + * Revision 1.12 2003/12/18 17:40:07 pelle + * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well. + * IdentityCreator has been modified to allow creation of keys. + * Note The actual Creation of Certificates still have a problem that will be resolved later today. + * * Revision 1.11 2003/12/16 21:09:22 pelle * The Sample Web App is semi stable for now. *************** *** 130,137 **** import org.neuclear.commons.NeuClearException; import org.neuclear.commons.crypto.CryptoException; import org.neuclear.commons.crypto.CryptoTools; ! import org.neuclear.commons.crypto.RawCertificate; import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent; import java.io.*; --- 135,144 ---- import org.neuclear.commons.NeuClearException; + import org.neuclear.commons.Utility; import org.neuclear.commons.crypto.CryptoException; import org.neuclear.commons.crypto.CryptoTools; ! import org.neuclear.commons.crypto.jce.RawCertificate; import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent; + import org.neuclear.commons.crypto.passphraseagents.UserCancelsException; import java.io.*; *************** *** 158,162 **** */ public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException { ! this(filename, new FileInputStream(new File(filename)), type, provider, agent); } /** --- 165,170 ---- */ public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException { ! this(filename, createInputStream(filename), type, provider, agent); ! this.filename=filename; } /** *************** *** 172,176 **** */ public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent,final char[] initialpassphrase) throws NeuClearException, GeneralSecurityException, FileNotFoundException { ! this(filename, new FileInputStream(new File(filename)), type, provider, agent,initialpassphrase); } --- 180,201 ---- */ public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent,final char[] initialpassphrase) throws NeuClearException, GeneralSecurityException, FileNotFoundException { ! this(filename, createInputStream(filename), type, provider, agent,initialpassphrase); ! this.filename=filename; ! ! } ! /** ! * The purpose of this method is to either return an InputStream or Null. The reason being that the Keystore accepts null ! * to create a new KeyStore in memory. ! * @param filename ! * @return ! * @throws FileNotFoundException ! */ ! private static InputStream createInputStream(final String filename) throws FileNotFoundException { ! if (Utility.isEmpty(filename)) ! return null; ! final File file = new File(filename); ! if (!file.exists()) ! return null; ! return new FileInputStream(file); } *************** *** 304,323 **** } ! /** ! * Creates a new KeyPair, stores the PrivateKey using the given alias ! * and returns the PublicKey. ! * ! * @param alias ! * @return Generated PublicKey ! * @throws org.neuclear.commons.crypto.CryptoException ! * ! */ public final PublicKey generateKey(final String alias) throws CryptoException { try { final KeyPair kp = kpg.generateKeyPair(); ! ks.setKeyEntry(alias, kp.getPrivate(), agent.getPassPhrase(alias), new Certificate[]{new RawCertificate(kp.getPublic())}); return kp.getPublic(); } catch (KeyStoreException e) { throw new CryptoException(e); } } --- 329,344 ---- } ! public final PublicKey generateKey(final String alias) throws CryptoException { try { final KeyPair kp = kpg.generateKeyPair(); ! ks.setKeyEntry(alias, kp.getPrivate(), agent.getPassPhrase(alias), new Certificate[]{CryptoTools.createCertificate(alias,kp)}); return kp.getPublic(); } catch (KeyStoreException e) { throw new CryptoException(e); + } catch (SignatureException e) { + throw new CryptoException(e); + } catch (InvalidKeyException e) { + throw new CryptoException(e); } } *************** *** 331,334 **** --- 352,369 ---- } + public void save() throws CryptoException { + save(filename); + } + public synchronized final void save(String filename) throws CryptoException{ + if (Utility.isEmpty(filename)) + throw new CryptoException("We dont have a filename"); + try { + File ksfile=new File(filename); + ksfile.getParentFile().mkdirs(); + ks.store(new FileOutputStream(ksfile),agent.getPassPhrase(filename)); + } catch (Exception e) { + throw new CryptoException(e); + } + } private final KeyStore ks; private final KeyCache cache; *************** *** 336,338 **** --- 371,374 ---- private final KeyPairGenerator kpg; + private String filename; } Index: Signer.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/Signer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Signer.java 10 Dec 2003 23:55:45 -0000 1.3 --- Signer.java 18 Dec 2003 17:40:07 -0000 1.4 *************** *** 2,5 **** --- 2,10 ---- * $Id$ * $Log$ + * Revision 1.4 2003/12/18 17:40:07 pelle + * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well. + * IdentityCreator has been modified to allow creation of keys. + * Note The actual Creation of Certificates still have a problem that will be resolved later today. + * * Revision 1.3 2003/12/10 23:55:45 pelle * Did some cleaning up in the builders *************** *** 87,90 **** --- 92,96 ---- import java.security.PublicKey; + import java.security.cert.Certificate; *************** *** 138,145 **** * Creates a new KeyPair, stores the PrivateKey using the given alias * and returns the PublicKey. ! * ! * @param alias * @return Generated PublicKey ! * @throws CryptoException */ public PublicKey generateKey(String alias) throws CryptoException; --- 144,151 ---- * Creates a new KeyPair, stores the PrivateKey using the given alias * and returns the PublicKey. ! * ! * @param alias * @return Generated PublicKey ! * @throws CryptoException */ public PublicKey generateKey(String alias) throws CryptoException; *************** *** 149,152 **** --- 155,160 ---- final public static int KEY_DSA = 2; final public static int KEY_OTHER = -1; + + void save() throws CryptoException; } Index: SimpleSigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/SimpleSigner.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SimpleSigner.java 16 Dec 2003 23:16:40 -0000 1.6 --- SimpleSigner.java 18 Dec 2003 17:40:07 -0000 1.7 *************** *** 2,5 **** --- 2,10 ---- * $Id$ * $Log$ + * Revision 1.7 2003/12/18 17:40:07 pelle + * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well. + * IdentityCreator has been modified to allow creation of keys. + * Note The actual Creation of Certificates still have a problem that will be resolved later today. + * * Revision 1.6 2003/12/16 23:16:40 pelle * Work done on the SigningServlet. The two phase web model is now only an option. *************** *** 121,124 **** --- 126,131 ---- import java.io.*; import java.security.*; + import java.security.cert.*; + import java.security.cert.Certificate; import java.security.spec.KeySpec; import java.security.spec.PKCS8EncodedKeySpec; *************** *** 245,256 **** } ! public final void save() throws IOException { if (signerFile.getParent() != null) signerFile.getParentFile().mkdirs(); ! final FileOutputStream f = new FileOutputStream(signerFile); ! final ObjectOutput s = new ObjectOutputStream(f); ! s.writeObject(ks); ! s.flush(); } --- 252,267 ---- } ! public final void save() throws CryptoException { if (signerFile.getParent() != null) signerFile.getParentFile().mkdirs(); ! try { ! final FileOutputStream f = new FileOutputStream(signerFile); ! final ObjectOutput s = new ObjectOutputStream(f); ! s.writeObject(ks); ! s.flush(); ! } catch (IOException e) { ! throw new CryptoException(e); ! } } *************** *** 269,282 **** return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data); } - - /** - * Creates a new KeyPair, stores the PrivateKey using the given alias - * and returns the PublicKey. - * - * @param alias - * @return Generated PublicKey - * @throws org.neuclear.commons.crypto.CryptoException - * - */ public final PublicKey generateKey(final String alias) throws CryptoException { try { --- 280,283 ---- |
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/jce
In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/java/org/neuclear/commons/crypto/jce
Added Files:
RawCertificate.java RawCertificateFactory.java
RawJCEProvider.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
--- NEW FILE: RawCertificate.java ---
package org.neuclear.commons.crypto.jce;
import org.neuclear.commons.crypto.CryptoTools;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
/*
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: RawCertificate.java,v 1.1 2003/12/18 17:40:07 pelle Exp $
$Log: RawCertificate.java,v $
Revision 1.1 2003/12/18 17:40:07 pelle
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Revision 1.4 2003/12/10 23:55:45 pelle
Did some cleaning up in the builders
Fixed some stuff in IdentityCreator
New maven goal to create executable jarapp
We are close to 0.8 final of ID, 0.11 final of XMLSIG and 0.5 of commons.
Will release shortly.
Revision 1.3 2003/12/06 00:16:35 pelle
Updated various areas in NSTools.
Updated URI Validation in particular to support new expanded format
Updated createUniqueID and friends to be a lot more unique and more efficient.
In CryptoTools updated getRandom() to finally use a SecureRandom.
Changed CryptoTools.getFormatURLSafe to getBase36 because that is what it really is.
Revision 1.2 2003/11/21 04:43:41 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Revision 1.1 2003/11/19 23:32:51 pelle
Signers now can generatekeys via the generateKey() method.
Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit.
SignedNamedObject now contains the full xml which is returned with getEncoded()
This means that it is now possible to further receive on or process a SignedNamedObject, leaving
NamedObjectBuilder for its original purposes of purely generating new Contracts.
NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it.
Updated all major interfaces that used the old model to use the new model.
*/
/**
* User: pelleb
* Date: Nov 19, 2003
* Time: 1:37:31 PM
*/
public final class RawCertificate extends Certificate {
public RawCertificate(final PublicKey pub) {
super("Raw");
this.pub = pub;
}
public final byte[] getEncoded() throws CertificateEncodingException {
return pub.getEncoded();
}
/**
* Not Implemented Pure Dummy
*
* @param publicKey
* @throws CertificateException
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
* @throws NoSuchProviderException
* @throws SignatureException
*/
public final void verify(final PublicKey publicKey) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
;
}
/**
* * Not Implemented Pure Dummy
*
* @param publicKey
* @param string
* @throws CertificateException
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
* @throws NoSuchProviderException
* @throws SignatureException
*/
public final void verify(final PublicKey publicKey, final String string) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
;
}
public final String toString() {
try {
return CryptoTools.formatAsBase36(CryptoTools.digest(getEncoded()));
} catch (Exception e) {
return "error";
}
}
public final PublicKey getPublicKey() {
return pub;
}
private final PublicKey pub;
}
--- NEW FILE: RawCertificateFactory.java ---
package org.neuclear.commons.crypto.jce;
import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.crypto.CryptoTools;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.PublicKey;
import java.security.cert.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
/*
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: RawCertificateFactory.java,v 1.1 2003/12/18 17:40:07 pelle Exp $
$Log: RawCertificateFactory.java,v $
Revision 1.1 2003/12/18 17:40:07 pelle
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Revision 1.8 2003/12/17 12:45:57 pelle
NeuClear JCE Certificates now work with KeyStore.
We can now create JCE certificates based on NeuClear Identity's and store them in a keystore.
Revision 1.7 2003/11/21 04:45:11 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Revision 1.6 2003/11/18 15:45:09 pelle
FileStoreTest now passes. FileStore works again.
Revision 1.5 2003/11/18 15:07:36 pelle
Changes to JCE Implementation
Working on getting all tests working including store tests
Revision 1.4 2003/11/11 21:18:42 pelle
Further vital reshuffling.
org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
Did a bit of work on the Canonicalizer and changed a few other minor bits.
Revision 1.3 2003/10/21 22:31:12 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/10/01 17:05:37 pelle
Moved the NeuClearCertificate class to be an inner class of Identity.
Revision 1.1 2003/09/30 23:25:15 pelle
Added new JCE Provider and java Certificate implementation for NeuClear Identity.
*/
/**
* This is the beginnings of integrating NeuClear into the JCE architecture allowing
* NeuClear to be plugged in relatively easily for other types of applications such as
* Code signing.
* <p>
* Currently the provider provides a CertificateFactory with the name NeuClear. This
* can be instantiated using:<br>
* <tt> CertificateFactory certfact=CertificateFactory.getInstance("NeuClear");</tt><p>
*
* User: pelleb
* Date: Sep 30, 2003
* Time: 4:39:08 PM
*/
public final class RawCertificateFactory extends CertificateFactorySpi {
static final String BEGIN_CERT = "-----BEGIN CERTIFICATE-----";
static final String END_CERT = "-----END CERTIFICATE-----";
final public Certificate engineGenerateCertificate(final InputStream inputStream) throws CertificateException {
try {
//Identity id=(Identity) VerifyingReader.getInstance().read(inputStream);
final BufferedReader d = new BufferedReader(new InputStreamReader(inputStream));
while(d.readLine().length()<2);//Skip any initial empty lines
if (!d.readLine().startsWith(BEGIN_CERT))
throw new CertificateException("Not a Valid Certificate");
StringBuffer buf=new StringBuffer();
String line=d.readLine();
while(line.length()>2&&!line.startsWith(END_CERT)){
buf.append(line);
line=d.readLine();
}
PublicKey pub=CryptoTools.getPublicKeyFromBase64(buf.toString());
return new RawCertificate(pub);
} catch (IOException e) {
throw new CertificateException("NeuClear: Problem reading Certificate:"+e.getMessage());
} catch (CryptoException e) {
throw new CertificateException("NeuClear: Problem reading Certificate:"+e.getMessage());
}
}
final public Collection engineGenerateCertificates(final InputStream inputStream) throws CertificateException {
final List list=new LinkedList();
try {
while(inputStream.available()>0) {
list.add(engineGenerateCertificate(inputStream));
}
} catch (IOException e) {
throw new CertificateException(e.getLocalizedMessage());
}
return list;
}
final public CRL engineGenerateCRL(final InputStream inputStream) throws CRLException {
return null;
}
final public Collection engineGenerateCRLs(final InputStream inputStream) throws CRLException {
return new ArrayList(0);
}
}
--- NEW FILE: RawJCEProvider.java ---
package org.neuclear.commons.crypto.jce;
import java.security.Provider;
/*
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: RawJCEProvider.java,v 1.1 2003/12/18 17:40:07 pelle Exp $
$Log: RawJCEProvider.java,v $
Revision 1.1 2003/12/18 17:40:07 pelle
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Revision 1.2 2003/10/01 17:05:37 pelle
Moved the NeuClearCertificate class to be an inner class of Identity.
Revision 1.1 2003/09/30 23:25:15 pelle
Added new JCE Provider and java Certificate implementation for NeuClear Identity.
*/
/**
* This is the beginnings of integrating NeuClear into the JCE architecture allowing
* NeuClear to be plugged in relatively easily for other types of applications such as
* Code signing.
* <p>
* Currently the provider provides a CertificateFactory with the name NeuClear. This
* can be instantiated using:<br>
* <tt> CertificateFactory certfact=CertificateFactory.getInstance("NeuClear");</tt><p>
*
* User: pelleb
* Date: Sep 30, 2003
* Time: 4:32:08 PM
*/
public final class RawJCEProvider extends Provider {
public RawJCEProvider() {
super("Raw", 0.5,"NeuClear Provider Implementing Certificates containing nothing but PublicKeys");
put("CertificateFactory.Raw","org.neuclear.commons.crypto.jce.RawCertificateFactory");
}
}
|
|
From: <pe...@us...> - 2003-12-18 16:32:54
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/jce In directory sc8-pr-cvs1:/tmp/cvs-serv13887/src/test/org/neuclear/commons/crypto/jce Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/jce added to the repository |
|
From: <pe...@us...> - 2003-12-18 14:32:49
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/jce In directory sc8-pr-cvs1:/tmp/cvs-serv20741/src/java/org/neuclear/commons/crypto/jce Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/jce added to the repository |
|
From: <pe...@us...> - 2003-12-17 23:53:53
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv17154/src/java/org/neuclear/signers/servlet
Added Files:
SignatureRequestServlet.java
Log Message:
Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
--- NEW FILE: SignatureRequestServlet.java ---
package org.neuclear.signers.servlet;
import org.neuclear.commons.servlets.ServletTools;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.ServletSignerFactory;
import org.neuclear.id.Identity;
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.builders.SignatureRequestBuilder;
import org.neuclear.xml.xmlsec.XMLSecTools;
import org.neuclear.xml.xmlsec.XMLSecurityException;
import org.neuclear.xml.XMLException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import java.security.GeneralSecurityException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
/*
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: SignatureRequestServlet.java,v 1.1 2003/12/17 23:53:50 pelle Exp $
$Log: SignatureRequestServlet.java,v $
Revision 1.1 2003/12/17 23:53:50 pelle
Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
*/
/**
* User: pelleb
* Date: Dec 17, 2003
* Time: 5:54:15 PM
*/
public abstract class SignatureRequestServlet extends HttpServlet {
public final void init(final ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
serviceid = ServletTools.getInitParam("serviceid",servletConfig);
title = ServletTools.getInitParam("title",servletConfig);
try {
signer = createSigner(servletConfig);
} catch (NeuClearException e) {
throw new ServletException(e);
} catch (GeneralSecurityException e) {
throw new ServletException(e);
} catch (FileNotFoundException e) {
throw new ServletException(e);
}
}
protected final String getServiceid() {
return serviceid;
}
protected final String getTitle() {
return title;
}
protected Signer createSigner(ServletConfig config) throws FileNotFoundException, GeneralSecurityException, NeuClearException {
return ServletSignerFactory.getInstance().createSigner(config);
}
protected final void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
response.setContentType("text/html");
final String siteurl = ServletTools.getAbsoluteURL(request, "/");
/*
final Cookie usercookie = new Cookie("identity", userns);
//usercookie.setSecure(true);
usercookie.setMaxAge(2592000);
response.addCookie(usercookie);
*/
final PrintWriter out = response.getWriter();
out.write("\n ");
out.write("<html>\n");
out.write("<head>");
out.write("<title>\n");
out.write(title);
out.write("</title>");
out.write("</head>\n");
out.write("<body>\n");
out.write("<h3>contacting signing service...");
out.write("</h3>\n");
out.flush();
try {
final Identity user = getUserNS(request);
final NamedObjectBuilder namedreq = createBuilder(request);
final SignatureRequestBuilder sigreq = new SignatureRequestBuilder(serviceid, user.getName(), namedreq, "Login to Site");
sigreq.sign(serviceid, signer);
out.write("<form action=\"");
out.print(user.getSigner());
out.write("\" method=\"POST\">\n ");
out.write("<input name=\"neuclear-request\" value=\"");
out.print(XMLSecTools.encodeElementBase64(sigreq));
out.write("\" type=\"hidden\">\n ");
out.write("<input name=\"endpoint\" value=\"");
out.print(siteurl);
out.write("\" type=\"hidden\"/>\n");
// out.write("<input type=\"submit\">");
out.write("</form>\n");
out.write("<script language=\"javascript\">\n");
out.write("<!--\n document.forms[0].submit();\n-->\n");
out.write("</script>\n");
} catch (NeuClearException e) {
e.printStackTrace(out);
} catch (XMLSecurityException e) {
e.printStackTrace(out);
} catch (XMLException e) {
e.printStackTrace(out);
}
}
protected Identity getUserNS(final HttpServletRequest request) throws NeuClearException {
if (request.getUserPrincipal()!=null)
return (Identity)request.getUserPrincipal();
final String username = request.getParameter("identity");
if (Utility.isEmpty(username))
throw new NeuClearException("No Identity Provided");
return NSResolver.resolveIdentity(username);
}
protected abstract NamedObjectBuilder createBuilder(HttpServletRequest request) throws NeuClearException;
private Signer signer;
private String serviceid;
private String title;
}
|
|
From: <pe...@us...> - 2003-12-17 23:53:53
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/auth
In directory sc8-pr-cvs1:/tmp/cvs-serv17154/src/java/org/neuclear/auth
Modified Files:
AuthenticationServlet.java
Log Message:
Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
Index: AuthenticationServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/auth/AuthenticationServlet.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** AuthenticationServlet.java 16 Dec 2003 15:04:59 -0000 1.11
--- AuthenticationServlet.java 17 Dec 2003 23:53:50 -0000 1.12
***************
*** 9,16 ****
--- 9,20 ----
import org.neuclear.id.builders.AuthenticationTicketBuilder;
import org.neuclear.id.builders.SignatureRequestBuilder;
+ import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.resolver.NSResolver;
+ import org.neuclear.id.Identity;
+ import org.neuclear.id.InvalidNamedObjectException;
import org.neuclear.xml.XMLException;
import org.neuclear.xml.xmlsec.XMLSecTools;
import org.neuclear.xml.xmlsec.XMLSecurityException;
+ import org.neuclear.signers.servlet.SignatureRequestServlet;
import javax.servlet.ServletConfig;
***************
*** 45,48 ****
--- 49,55 ----
$Id$
$Log$
+ Revision 1.12 2003/12/17 23:53:50 pelle
+ Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
+
Revision 1.11 2003/12/16 15:04:59 pelle
Added SignedMessage contract for signing simple textual contracts.
***************
*** 108,195 ****
* Time: 2:04:31 PM
*/
! public class AuthenticationServlet extends HttpServlet {
! public final void init(final ServletConfig servletConfig) throws ServletException {
! super.init(servletConfig);
! serviceid = ServletTools.getInitParam("serviceid",servletConfig);
! title = ServletTools.getInitParam("title",servletConfig);
!
! try {
! signer = createSigner(servletConfig);
! } catch (NeuClearException e) {
! throw new ServletException(e);
! } catch (GeneralSecurityException e) {
! throw new ServletException(e);
! } catch (FileNotFoundException e) {
! throw new ServletException(e);
! }
!
! }
! protected Signer createSigner(ServletConfig config) throws FileNotFoundException, GeneralSecurityException, NeuClearException {
! return ServletSignerFactory.getInstance().createSigner(config);
! }
! protected final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
!
! }
!
! protected final void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
! response.setHeader("Pragma", "no-cache");
! response.setDateHeader("Expires", 0);
! response.setContentType("text/html");
! final String siteurl = ServletTools.getAbsoluteURL(request, "/");
final String userns = request.getParameter("identity");
! if (Utility.isEmpty(userns)) {
! response.sendError(500, "No Identity");
! response.flushBuffer();
! return;
! }
! final Cookie usercookie = new Cookie("identity", userns);
! //usercookie.setSecure(true);
! usercookie.setMaxAge(2592000);
! response.addCookie(usercookie);
! final PrintWriter out = response.getWriter();
! out.write("\n ");
! out.write("<html>\n");
! out.write("<head>");
! out.write("<title>\n");
! out.write(title);
! out.write("</title>");
! out.write("</head>\n");
! out.write("<body>\n");
! out.write("<h3>contacting signing service...");
! out.write("</h3>\n");
! out.flush();
!
! try {
! final AuthenticationTicketBuilder authreq = new AuthenticationTicketBuilder(userns, serviceid, request.getRequestURI());
! final SignatureRequestBuilder sigreq = new SignatureRequestBuilder(serviceid, userns, authreq, "Login to Site");
! sigreq.sign(serviceid, signer);
! request.getSession(true).setAttribute("auth", userns);
! out.write("<form action=\"");
! out.print(NSResolver.resolveIdentity(userns).getSigner());
! out.write("\" method=\"POST\">\n ");
! out.write("<input name=\"neuclear-request\" value=\"");
! out.print(XMLSecTools.encodeElementBase64(sigreq));
! out.write("\" type=\"hidden\">\n ");
! out.write("<input name=\"endpoint\" value=\"");
! out.print(siteurl);
! out.write("\" type=\"hidden\"/>\n");
! // out.write("<input type=\"submit\">");
! out.write("</form>\n");
! out.write("<script language=\"javascript\">\n");
! out.write("<!--\n document.forms[0].submit();\n-->\n");
! out.write("</script>\n");
!
! } catch (NeuClearException e) {
! e.printStackTrace(out);
! } catch (XMLSecurityException e) {
! e.printStackTrace(out);
! } catch (XMLException e) {
! e.printStackTrace(out);
! }
}
- private Signer signer;
- private String serviceid;
- private String title;
}
--- 115,125 ----
* Time: 2:04:31 PM
*/
! public class AuthenticationServlet extends SignatureRequestServlet {
! protected NamedObjectBuilder createBuilder(final HttpServletRequest request) throws NeuClearException {
final String userns = request.getParameter("identity");
! request.getSession(true).setAttribute("auth", userns);
! return new AuthenticationTicketBuilder(userns, getServiceid(), request.getRequestURI());
}
}
|
|
From: <pe...@us...> - 2003-12-17 23:53:01
|
Update of /cvsroot/neuclear/neuclear-pay/src/webapp/WEB-INF
In directory sc8-pr-cvs1:/tmp/cvs-serv16936/src/webapp/WEB-INF
Modified Files:
web.xml
Log Message:
Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
Index: web.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/webapp/WEB-INF/web.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** web.xml 15 Dec 2003 23:31:54 -0000 1.4
--- web.xml 17 Dec 2003 23:52:57 -0000 1.5
***************
*** 25,28 ****
--- 25,32 ----
<param-value>test</param-value>
</context-param>
+ <context-param>
+ <param-name>datasource</param-name>
+ <param-value>jdbc/AssetDS</param-value>
+ </context-param>
<filter>
<filter-name>authfilter</filter-name>
***************
*** 49,57 ****
<servlet-mapping>
<servlet-name>assetcontroller</servlet-name>
! <url-pattern>Asset</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>authenticator</servlet-name>
! <url-pattern>Authorize</url-pattern>
</servlet-mapping>
<welcome-file-list>
--- 53,61 ----
<servlet-mapping>
<servlet-name>assetcontroller</servlet-name>
! <url-pattern>/Asset</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>authenticator</servlet-name>
! <url-pattern>/Authorize</url-pattern>
</servlet-mapping>
<welcome-file-list>
|
|
From: <pe...@us...> - 2003-12-17 23:53:01
|
Update of /cvsroot/neuclear/neuclear-pay/src/webapp/SECURE
In directory sc8-pr-cvs1:/tmp/cvs-serv16936/src/webapp/SECURE
Modified Files:
transfer.jsp
Log Message:
Added SignatureRequestServlet which is abstract and can be used for building SignatureRequests for various applications.
Index: transfer.jsp
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/webapp/SECURE/transfer.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** transfer.jsp 12 Dec 2003 21:12:54 -0000 1.4
--- transfer.jsp 17 Dec 2003 23:52:57 -0000 1.5
***************
*** 15,21 ****
AssetGlobals.registerReaders();
TransferGlobals.registerReaders();
- AssetControllerServlet controller=AssetControllerServlet.getInstance();
Identity userns=(Identity) request.getUserPrincipal();
!
String recipient=Utility.denullString(request.getParameter("recipient"));
double amount=Double.parseDouble(Utility.denullString(request.getParameter("amount"),"0"));
--- 15,21 ----
AssetGlobals.registerReaders();
TransferGlobals.registerReaders();
Identity userns=(Identity) request.getUserPrincipal();
! String service=ServletTools.getInitParam("service",config);
! Asset asset=(Asset)NSResolver.resolveIdentity(service);
String recipient=Utility.denullString(request.getParameter("recipient"));
double amount=Double.parseDouble(Utility.denullString(request.getParameter("amount"),"0"));
***************
*** 47,53 ****
</p>
<% } else {
- Servlet servlet=config.getServletContext().getServlet("");
TransferRequestBuilder transfer=new TransferRequestBuilder(
! controller.getAsset(),
userns,
NSResolver.resolveIdentity(recipient),
--- 47,52 ----
</p>
<% } else {
TransferRequestBuilder transfer=new TransferRequestBuilder(
! asset,
userns,
NSResolver.resolveIdentity(recipient),
***************
*** 56,61 ****
comment
) ;
! SignatureRequestBuilder sigreq=new SignatureRequestBuilder(controller.getServiceid(),userns.getName(),transfer,comment);
! SignedNamedObject sig=sigreq.sign(controller.getSigner());
%>
--- 55,60 ----
comment
) ;
! SignatureRequestBuilder sigreq=new SignatureRequestBuilder(service,userns.getName(),transfer,comment);
! SignedNamedObject sig=sigreq.sign(getSigner());
%>
|