|
From: <pe...@us...> - 2003-11-21 04:43:45
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/java/org/neuclear/commons/crypto/signers
Modified Files:
DefaultSigner.java InvalidPassphraseException.java
JCESigner.java KeyCache.java NonExistingSignerException.java
SimpleSigner.java TestCaseSigner.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: DefaultSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/DefaultSigner.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DefaultSigner.java 12 Nov 2003 23:47:50 -0000 1.2
--- DefaultSigner.java 21 Nov 2003 04:43:41 -0000 1.3
***************
*** 28,31 ****
--- 28,37 ----
$Id$
$Log$
+ 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/12 23:47:50 pelle
Much work done in creating good test environment.
***************
*** 56,61 ****
* Time: 3:22:17 PM
*/
! public class DefaultSigner extends JCESigner {
! public DefaultSigner(PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
super(CryptoTools.DEFAULT_KEYSTORE, "jks", "SUN", agent);
--- 62,67 ----
* Time: 3:22:17 PM
*/
! public final class DefaultSigner extends JCESigner {
! public DefaultSigner(final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
super(CryptoTools.DEFAULT_KEYSTORE, "jks", "SUN", agent);
Index: InvalidPassphraseException.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/InvalidPassphraseException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** InvalidPassphraseException.java 11 Nov 2003 21:17:47 -0000 1.1
--- InvalidPassphraseException.java 21 Nov 2003 04:43:41 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * 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/11 21:17:47 pelle
* Further vital reshuffling.
***************
*** 39,48 ****
import org.neuclear.commons.crypto.CryptoException;
! public class InvalidPassphraseException extends CryptoException {
public InvalidPassphraseException() {
super("Passphrase incorrect.");
}
! public InvalidPassphraseException(String msg) {
super(msg);
}
--- 45,54 ----
import org.neuclear.commons.crypto.CryptoException;
! public final class InvalidPassphraseException extends CryptoException {
public InvalidPassphraseException() {
super("Passphrase incorrect.");
}
! public InvalidPassphraseException(final String msg) {
super(msg);
}
Index: JCESigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/JCESigner.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** JCESigner.java 19 Nov 2003 23:32:50 -0000 1.6
--- JCESigner.java 21 Nov 2003 04:43:41 -0000 1.7
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.7 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.6 2003/11/19 23:32:50 pelle
* Signers now can generatekeys via the generateKey() method.
***************
*** 116,128 ****
public class JCESigner implements org.neuclear.commons.crypto.signers.Signer, PublicKeySource {
! public JCESigner(String filename, String type, String provider, PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException {
this(filename, new FileInputStream(new File(filename)), type, provider, agent);
}
! protected JCESigner(String name, InputStream in, String type, String provider, PassPhraseAgent agent) throws NeuClearException {
this(loadKeyStore(provider, type, in, agent, name), agent);
}
! private static KeyStore loadKeyStore(String provider, String type, InputStream in, PassPhraseAgent agent, String name) throws NeuClearException {
try {
KeyStore ki = null;
--- 122,134 ----
public class JCESigner implements org.neuclear.commons.crypto.signers.Signer, PublicKeySource {
! 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);
}
! 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);
}
! private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final PassPhraseAgent agent, final String name) throws NeuClearException {
try {
KeyStore ki = null;
***************
*** 147,151 ****
}
! public JCESigner(KeyStore ks, PassPhraseAgent agent) throws CryptoException {
this.agent = agent;
this.ks = ks;
--- 153,157 ----
}
! public JCESigner(final KeyStore ks, final PassPhraseAgent agent) throws CryptoException {
this.agent = agent;
this.ks = ks;
***************
*** 160,166 ****
}
! private PrivateKey getKey(String name, char passphrase[]) throws InvalidPassphraseException, NonExistingSignerException, IOException {
try {
! PrivateKey key = (PrivateKey) cache.getKey(name, passphrase);
if (key == null)
throw new NonExistingSignerException("No keys for: " + name);
--- 166,172 ----
}
! private PrivateKey getKey(final String name, final char[] passphrase) throws InvalidPassphraseException, NonExistingSignerException, IOException {
try {
! final PrivateKey key = (PrivateKey) cache.getKey(name, passphrase);
if (key == null)
throw new NonExistingSignerException("No keys for: " + name);
***************
*** 183,187 ****
* if the passphrase doesn't match
*/
! public byte[] sign(String name, byte data[]) throws CryptoException {
try {
--- 189,193 ----
* if the passphrase doesn't match
*/
! public final byte[] sign(final String name, final byte[] data) throws CryptoException {
try {
***************
*** 192,196 ****
}
! public boolean canSignFor(String name) throws CryptoException {
try {
return ks.containsAlias(name);
--- 198,202 ----
}
! public final boolean canSignFor(final String name) throws CryptoException {
try {
return ks.containsAlias(name);
***************
*** 207,214 ****
* @throws CryptoException
*/
! public int getKeyType(String name) throws CryptoException {
try {
if (ks.isKeyEntry(name)) {
! PublicKey pk = getPublicKey(name);
if (pk instanceof RSAPublicKey)
return KEY_RSA;
--- 213,220 ----
* @throws CryptoException
*/
! public final int getKeyType(final String name) throws CryptoException {
try {
if (ks.isKeyEntry(name)) {
! final PublicKey pk = getPublicKey(name);
if (pk instanceof RSAPublicKey)
return KEY_RSA;
***************
*** 232,238 ****
*
*/
! public PublicKey generateKey(String alias) throws CryptoException {
try {
! KeyPair kp = kpg.generateKeyPair();
ks.setKeyEntry(alias, kp.getPrivate(), agent.getPassPhrase(alias), new Certificate[]{new RawCertificate(kp.getPublic())});
return kp.getPublic();
--- 238,244 ----
*
*/
! 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();
***************
*** 242,246 ****
}
! public PublicKey getPublicKey(String name) throws CryptoException {
try {
return ks.getCertificate(name).getPublicKey();
--- 248,252 ----
}
! public final PublicKey getPublicKey(final String name) throws CryptoException {
try {
return ks.getCertificate(name).getPublicKey();
Index: KeyCache.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/KeyCache.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** KeyCache.java 18 Nov 2003 00:01:02 -0000 1.1
--- KeyCache.java 21 Nov 2003 04:43:41 -0000 1.2
***************
*** 27,30 ****
--- 27,36 ----
$Id$
$Log$
+ 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/18 00:01:02 pelle
The sample signing web application for logging in and out is now working.
***************
*** 37,52 ****
* is a SHA1 Digest of the alias and the passphrase
*/
! public class KeyCache {
! public KeyCache(KeyStore ks) {
this.cache = new HashMap();
this.ks = ks;
}
! public Key getKey(String alias, char passphrase[]) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, NonExistingSignerException {
! String hash = createHash(alias, passphrase);
if (cache.containsKey(hash))
return (Key) cache.get(hash);
if (ks.containsAlias(alias)) {
! Key key = ks.getKey(alias, passphrase);
cache.put(hash, key);
return key;
--- 43,58 ----
* is a SHA1 Digest of the alias and the passphrase
*/
! public final class KeyCache {
! public KeyCache(final KeyStore ks) {
this.cache = new HashMap();
this.ks = ks;
}
! public final Key getKey(final String alias, final char[] passphrase) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, NonExistingSignerException {
! final String hash = createHash(alias, passphrase);
if (cache.containsKey(hash))
return (Key) cache.get(hash);
if (ks.containsAlias(alias)) {
! final Key key = ks.getKey(alias, passphrase);
cache.put(hash, key);
return key;
***************
*** 55,65 ****
}
! public final static String createHash(String alias, char passphrase[]) {
! Digest dig = new org.bouncycastle.crypto.digests.SHA1Digest();
! byte a[] = alias.getBytes();
dig.update(a, 0, a.length);
! byte p[] = new String(passphrase).getBytes();
dig.update(p, 0, p.length);
! byte hash[] = new byte[dig.getDigestSize()];
dig.doFinal(hash, 0);
return new String(hash);
--- 61,71 ----
}
! public final static String createHash(final String alias, final char[] passphrase) {
! final Digest dig = new org.bouncycastle.crypto.digests.SHA1Digest();
! final byte[] a = alias.getBytes();
dig.update(a, 0, a.length);
! final byte[] p = new String(passphrase).getBytes();
dig.update(p, 0, p.length);
! final byte[] hash = new byte[dig.getDigestSize()];
dig.doFinal(hash, 0);
return new String(hash);
***************
*** 68,72 ****
}
! private KeyStore ks;
! private Map cache;
}
--- 74,78 ----
}
! private final KeyStore ks;
! private final Map cache;
}
Index: NonExistingSignerException.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/NonExistingSignerException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NonExistingSignerException.java 11 Nov 2003 21:17:47 -0000 1.1
--- NonExistingSignerException.java 21 Nov 2003 04:43:41 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * 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/11 21:17:47 pelle
* Further vital reshuffling.
***************
*** 39,48 ****
import org.neuclear.commons.crypto.CryptoException;
! public class NonExistingSignerException extends CryptoException {
public NonExistingSignerException() {
super("Couldnt Sign. Non existent key.");
}
! public NonExistingSignerException(String name) {
super("Couldnt sign for: " + name);
}
--- 45,54 ----
import org.neuclear.commons.crypto.CryptoException;
! public final class NonExistingSignerException extends CryptoException {
public NonExistingSignerException() {
super("Couldnt Sign. Non existent key.");
}
! public NonExistingSignerException(final String name) {
super("Couldnt sign for: " + name);
}
Index: SimpleSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/SimpleSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleSigner.java 19 Nov 2003 23:32:50 -0000 1.3
--- SimpleSigner.java 21 Nov 2003 04:43:41 -0000 1.4
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.4 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.3 2003/11/19 23:32:50 pelle
* Signers now can generatekeys via the generateKey() method.
***************
*** 109,115 ****
* Currently it doesnt even use the passphrase. However it does do a SHA1 digest on the name first.
*/
! public class SimpleSigner implements Signer {
! public SimpleSigner(String file, PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
this.agent = agent;
try {
--- 115,121 ----
* Currently it doesnt even use the passphrase. However it does do a SHA1 digest on the name first.
*/
! public final class SimpleSigner implements Signer {
! public SimpleSigner(final String file, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
this.agent = agent;
try {
***************
*** 117,122 ****
if (signerFile.exists()) {
System.out.println("NEUDIST: Loading KeyStore");
! FileInputStream in = new FileInputStream(signerFile);
! ObjectInputStream s = new ObjectInputStream(in);
ks = (HashMap) s.readObject();
} else
--- 123,128 ----
if (signerFile.exists()) {
System.out.println("NEUDIST: Loading KeyStore");
! final FileInputStream in = new FileInputStream(signerFile);
! final ObjectInputStream s = new ObjectInputStream(in);
ks = (HashMap) s.readObject();
} else
***************
*** 138,157 ****
}
! private PrivateKey getKey(String name, char passphrase[]) throws CryptoException, NonExistingSignerException {
System.out.println("NEUDIST: UnSealing key " + name + " ...");
! byte encrypted[] = (byte[]) ks.get(getDigestedName(name));
if (encrypted == null)
throw new NonExistingSignerException("Signer " + name + "doesnt exist in this Store");
! ByteArrayInputStream bis = new ByteArrayInputStream(encrypted);
byte keyBytes[] = new byte[0];
try {
! Cipher c = CryptoTools.makePBECipher(Cipher.DECRYPT_MODE, passphrase);
! CipherInputStream cin = new CipherInputStream(bis, c);
! DataInputStream din = new DataInputStream(cin);
//byte keyBytes[]=new byte[c.getOutputSize(encrypted.length)];
if (din.readInt() != 11870) //This is just a quick check to see if the passphrase worked
throw new InvalidPassphraseException("Passphrase Didnt Match");
! int i = din.readInt();
// Sanity Check
if (i > 5000)
--- 144,163 ----
}
! private PrivateKey getKey(final String name, final char[] passphrase) throws CryptoException, NonExistingSignerException {
System.out.println("NEUDIST: UnSealing key " + name + " ...");
! final byte[] encrypted = (byte[]) ks.get(getDigestedName(name));
if (encrypted == null)
throw new NonExistingSignerException("Signer " + name + "doesnt exist in this Store");
! final ByteArrayInputStream bis = new ByteArrayInputStream(encrypted);
byte keyBytes[] = new byte[0];
try {
! final Cipher c = CryptoTools.makePBECipher(Cipher.DECRYPT_MODE, passphrase);
! final CipherInputStream cin = new CipherInputStream(bis, c);
! final DataInputStream din = new DataInputStream(cin);
//byte keyBytes[]=new byte[c.getOutputSize(encrypted.length)];
if (din.readInt() != 11870) //This is just a quick check to see if the passphrase worked
throw new InvalidPassphraseException("Passphrase Didnt Match");
! final int i = din.readInt();
// Sanity Check
if (i > 5000)
***************
*** 160,164 ****
din.readFully(keyBytes, 0, keyBytes.length);
din.close();
! KeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
return kf.generatePrivate(spec);
} catch (GeneralSecurityException e) {
--- 166,170 ----
din.readFully(keyBytes, 0, keyBytes.length);
din.close();
! final KeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
return kf.generatePrivate(spec);
} catch (GeneralSecurityException e) {
***************
*** 177,181 ****
*/
! public void addKey(String name, PrivateKey key) throws GeneralSecurityException, IOException {
addKey(name, agent.getPassPhrase(name), key);
}
--- 183,187 ----
*/
! public final void addKey(final String name, final PrivateKey key) throws GeneralSecurityException, IOException {
addKey(name, agent.getPassPhrase(name), key);
}
***************
*** 189,209 ****
*/
! public void addKey(String name, char passphrase[], PrivateKey key) throws GeneralSecurityException, IOException {
System.out.println("NEUDIST: Sealing key: " + name + " in format " + key.getFormat());
! ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DataOutputStream dOut = new DataOutputStream(bOut);
! Cipher c = CryptoTools.makePBECipher(Cipher.ENCRYPT_MODE, passphrase);
! CipherOutputStream cOut = new CipherOutputStream(dOut, c);
dOut = new DataOutputStream(cOut);
dOut.writeInt(11870);//This is just a quick check to see if the passphrase worked
! byte keyBytes[] = key.getEncoded(); //I'm assuming this is PKCS8, If not tough dooda
dOut.writeInt(keyBytes.length);
dOut.write(keyBytes);
dOut.close();
! byte encrypted[] = bOut.toByteArray();
ks.put(getDigestedName(name), encrypted);
}
! public boolean canSignFor(String name) throws CryptoException {
return ks.containsKey(getDigestedName(name));
}
--- 195,215 ----
*/
! public final void addKey(final String name, final char[] passphrase, final PrivateKey key) throws GeneralSecurityException, IOException {
System.out.println("NEUDIST: Sealing key: " + name + " in format " + key.getFormat());
! final ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DataOutputStream dOut = new DataOutputStream(bOut);
! final Cipher c = CryptoTools.makePBECipher(Cipher.ENCRYPT_MODE, passphrase);
! final CipherOutputStream cOut = new CipherOutputStream(dOut, c);
dOut = new DataOutputStream(cOut);
dOut.writeInt(11870);//This is just a quick check to see if the passphrase worked
! final byte[] keyBytes = key.getEncoded(); //I'm assuming this is PKCS8, If not tough dooda
dOut.writeInt(keyBytes.length);
dOut.write(keyBytes);
dOut.close();
! final byte[] encrypted = bOut.toByteArray();
ks.put(getDigestedName(name), encrypted);
}
! public final boolean canSignFor(final String name) throws CryptoException {
return ks.containsKey(getDigestedName(name));
}
***************
*** 216,233 ****
* @throws CryptoException
*/
! public int getKeyType(String name) throws CryptoException {
return (canSignFor(name)) ? KEY_RSA : KEY_NONE; // We always use RSA here
}
! static final protected String getDigestedName(String name) {
return new String(CryptoTools.digest(name.getBytes()));
}
! public void save() throws IOException {
if (signerFile.getParent() != null)
signerFile.getParentFile().mkdirs();
! FileOutputStream f = new FileOutputStream(signerFile);
! ObjectOutput s = new ObjectOutputStream(f);
s.writeObject(ks);
s.flush();
--- 222,239 ----
* @throws CryptoException
*/
! public final int getKeyType(final String name) throws CryptoException {
return (canSignFor(name)) ? KEY_RSA : KEY_NONE; // We always use RSA here
}
! static final protected String getDigestedName(final String name) {
return new String(CryptoTools.digest(name.getBytes()));
}
! 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();
***************
*** 244,248 ****
*/
! public byte[] sign(String name, byte data[]) throws CryptoException {
return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data);
--- 250,254 ----
*/
! public final byte[] sign(final String name, final byte[] data) throws CryptoException {
return CryptoTools.sign(getKey(name, agent.getPassPhrase(name)), data);
***************
*** 258,264 ****
*
*/
! public PublicKey generateKey(String alias) throws CryptoException {
try {
! KeyPair kp = kpg.generateKeyPair();
addKey(alias, agent.getPassPhrase(alias), kp.getPrivate());
return kp.getPublic();
--- 264,270 ----
*
*/
! public final PublicKey generateKey(final String alias) throws CryptoException {
try {
! final KeyPair kp = kpg.generateKeyPair();
addKey(alias, agent.getPassPhrase(alias), kp.getPrivate());
return kp.getPublic();
Index: TestCaseSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/TestCaseSigner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestCaseSigner.java 18 Nov 2003 23:34:55 -0000 1.5
--- TestCaseSigner.java 21 Nov 2003 04:43:41 -0000 1.6
***************
*** 29,32 ****
--- 29,38 ----
$Id$
$Log$
+ Revision 1.6 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.5 2003/11/18 23:34:55 pelle
Payment Web Application is getting there.
***************
*** 56,60 ****
* keystore passphrase are the same.
*/
! public class TestCaseSigner extends JCESigner {
/**
--- 62,66 ----
* keystore passphrase are the same.
*/
! public final class TestCaseSigner extends JCESigner {
/**
***************
*** 70,74 ****
}
! public TestCaseSigner(PassPhraseAgent agent) throws GeneralSecurityException, NeuClearException {
this(KEYSTORE, getKeyStore(), agent);
}
--- 76,80 ----
}
! public TestCaseSigner(final PassPhraseAgent agent) throws GeneralSecurityException, NeuClearException {
this(KEYSTORE, getKeyStore(), agent);
}
***************
*** 84,92 ****
* @throws GeneralSecurityException
*/
! public TestCaseSigner(String name, InputStream in, String passphrase) throws NeuClearException, GeneralSecurityException {
this(name, in, new AlwaysTheSamePassphraseAgent(passphrase));
}
! public TestCaseSigner(String name, InputStream in, PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException {
super(name,
in,
--- 90,98 ----
* @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,
***************
*** 97,101 ****
private static InputStream getKeyStore() {
! URL url = TestCaseSigner.class.getClassLoader().getResource(KEYSTORE);
System.out.println("loading keystore from: " + url.toString());
return TestCaseSigner.class.getClassLoader().getResourceAsStream(KEYSTORE);
--- 103,107 ----
private static InputStream getKeyStore() {
! final URL url = TestCaseSigner.class.getClassLoader().getResource(KEYSTORE);
System.out.println("loading keystore from: " + url.toString());
return TestCaseSigner.class.getClassLoader().getResourceAsStream(KEYSTORE);
|