|
From: <pe...@us...> - 2003-11-20 23:42:27
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv31294/src/java/org/neuclear/id
Modified Files:
Identity.java
Log Message:
Getting all the tests to work in id
Removing usage of BC in CryptoTools as it was causing issues.
First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without
writing SQL. (Yipee)
Index: Identity.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** Identity.java 20 Nov 2003 16:01:25 -0000 1.20
--- Identity.java 20 Nov 2003 23:42:24 -0000 1.21
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.21 2003/11/20 23:42:24 pelle
+ * Getting all the tests to work in id
+ * Removing usage of BC in CryptoTools as it was causing issues.
+ * First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without
+ * writing SQL. (Yipee)
+ *
* Revision 1.20 2003/11/20 16:01:25 pelle
* Did a security review of the basic Verification process and needed to make changes.
***************
*** 268,273 ****
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
- import java.sql.Timestamp;
import java.util.ArrayList;
/**
--- 274,279 ----
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
+ import java.util.Iterator;
/**
***************
*** 290,294 ****
public class Identity extends SignedNamedObject implements Principal {
private static final String NSROOTPKMOD = "pu/UOt9AKPt9txz/1TyYseL0vMUZXDxpz3PboE3X7J6r1UbfC9b45eO9SlD1wP52nCkVd5qL0fMOQV4lxP0KiL0DwCPid99YCXEn8BU4hEKLV3gD930ieFDtRhgDk7tcFzAqd6ilhVr3NENSjLRmlXK30qPmLRnDqhmx+UC7hLikhT6eJjDBatiYK4ESr2R5x/udIaJTSsenVA2zs1h2FcKXYExxJrPQBm0AXxguVlhqy+ImSjFQUEH9WOpr3zGLtXtcgawxtdapS8nwxbY38JR0HPloOWkFTC6XyurKr7TcDSrzgAUmJRy52pUvsqFRFcHxljL+Flv5iQS8TciKBQ==";
! //private static final String NSROOTPKMOD = "AKbv1DrfQCj7fbcc/9U8mLHi9LzFGVw8ac9z26BN1+yeq9VG3wvW+OXjvUpQ9cD+dpwpFXeai9Hz DkFeJcT9Coi9A8Aj4nffWAlxJ/AVOIRCi1d4A/d9InhQ7UYYA5O7XBcwKneopYVa9zRDUoy0ZpVy t9Kj5i0Zw6oZsflAu4S4pIU+niYwwWrYmCuBEq9kecf7nSGiU0rHp1QNs7NYdhXCl2BMcSaz0AZt AF8YLlZYasviJkoxUFBB/Vjqa98xi7V7XIGsMbXWqUvJ8MW2N/CUdBz5aDlpBUwul8rqyq+03A0q 84AFJiUcudqVL7KhURXB8ZYy/hZb+YkEvE3IigU=";
private static final String NSROOTPKEXP = "AQAB";
private static PublicKey nsrootpk;
--- 296,300 ----
public class Identity extends SignedNamedObject implements Principal {
private static final String NSROOTPKMOD = "pu/UOt9AKPt9txz/1TyYseL0vMUZXDxpz3PboE3X7J6r1UbfC9b45eO9SlD1wP52nCkVd5qL0fMOQV4lxP0KiL0DwCPid99YCXEn8BU4hEKLV3gD930ieFDtRhgDk7tcFzAqd6ilhVr3NENSjLRmlXK30qPmLRnDqhmx+UC7hLikhT6eJjDBatiYK4ESr2R5x/udIaJTSsenVA2zs1h2FcKXYExxJrPQBm0AXxguVlhqy+ImSjFQUEH9WOpr3zGLtXtcgawxtdapS8nwxbY38JR0HPloOWkFTC6XyurKr7TcDSrzgAUmJRy52pUvsqFRFcHxljL+Flv5iQS8TciKBQ==";
! // private static final String NSROOTPKMOD = "AKbv1DrfQCj7fbcc/9U8mLHi9LzFGVw8ac9z26BN1+yeq9VG3wvW+OXjvUpQ9cD+dpwpFXeai9Hz DkFeJcT9Coi9A8Aj4nffWAlxJ/AVOIRCi1d4A/d9InhQ7UYYA5O7XBcwKneopYVa9zRDUoy0ZpVy t9Kj5i0Zw6oZsflAu4S4pIU+niYwwWrYmCuBEq9kecf7nSGiU0rHp1QNs7NYdhXCl2BMcSaz0AZt AF8YLlZYasviJkoxUFBB/Vjqa98xi7V7XIGsMbXWqUvJ8MW2N/CUdBz5aDlpBUwul8rqyq+03A0q 84AFJiUcudqVL7KhURXB8ZYy/hZb+YkEvE3IigU=";
private static final String NSROOTPKEXP = "AQAB";
private static PublicKey nsrootpk;
***************
*** 316,328 ****
}
! public final String getSigner() {
return signer;
}
! public final String getLogger() {
return logger;
}
! public SignedNamedObject send(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(receiver))
return Sender.quickSend(receiver, obj);
--- 322,334 ----
}
! public final String getSigner() {
return signer;
}
! public final String getLogger() {
return logger;
}
! public SignedNamedObject send(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(receiver))
return Sender.quickSend(receiver, obj);
***************
*** 331,335 ****
}
! final void log(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(logger))
Sender.quickSend(logger, obj);
--- 337,341 ----
}
! final void log(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(logger))
Sender.quickSend(logger, obj);
***************
*** 340,344 ****
}
! public final Certificate getCertificate() {
return new NeuClearCertificate();
}
--- 346,350 ----
}
! public final java.security.cert.Certificate getCertificate() {
return new NeuClearCertificate();
}
***************
*** 365,378 ****
public static final Identity NEUROOT = createRootIdentity();
! public final Certificate[] getCertificateChain() {
ArrayList certs = new ArrayList(3);
Identity id = this;
! while (id != null || id.getName().equals("neu://")) {
certs.add(id.getCertificate());
id = id.getSignatory();
}
! certs.add(NEUROOT);
certs.trimToSize();
! return (Certificate[]) certs.toArray();
}
--- 371,391 ----
public static final Identity NEUROOT = createRootIdentity();
! public final java.security.cert.Certificate[] getCertificateChain() {
ArrayList certs = new ArrayList(3);
Identity id = this;
! while (id != null) {
certs.add(id.getCertificate());
id = id.getSignatory();
}
! certs.add(NEUROOT.getCertificate());
certs.trimToSize();
! Certificate cert[] = new Certificate[certs.size()];
! Iterator iter = certs.iterator();
! int i = 0;
! while (iter.hasNext()) {
! Certificate certificate = (java.security.cert.Certificate) iter.next();
! cert[i++] = certificate;
! }
! return cert;
}
***************
*** 380,384 ****
* Returns the fixed Root PublicKey
*/
! private final static PublicKey getRootPK() throws CryptoException {
if (nsrootpk == null)
nsrootpk = CryptoTools.createPK(NSROOTPKMOD, NSROOTPKEXP);
--- 393,397 ----
* Returns the fixed Root PublicKey
*/
! final static PublicKey getRootPK() throws CryptoException {
if (nsrootpk == null)
nsrootpk = CryptoTools.createPK(NSROOTPKMOD, NSROOTPKEXP);
***************
*** 409,417 ****
*
* @param publicKey
! * @throws CertificateException
! * @throws NoSuchAlgorithmException
! * @throws InvalidKeyException
! * @throws NoSuchProviderException
! * @throws SignatureException
*/
public final void verify(PublicKey publicKey) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
--- 422,434 ----
*
* @param publicKey
! * @throws CertificateException
! * @throws java.security.NoSuchAlgorithmException
! *
! * @throws java.security.InvalidKeyException
! *
! * @throws java.security.NoSuchProviderException
! *
! * @throws java.security.SignatureException
! *
*/
public final void verify(PublicKey publicKey) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
***************
*** 424,428 ****
}
! public final PublicKey getPublicKey() {
return pub;
}
--- 441,445 ----
}
! public final PublicKey getPublicKey() {
return pub;
}
***************
*** 451,455 ****
KeyInfo ki = new KeyInfo(allowElement.element(XMLSecTools.createQName("KeyInfo")));
PublicKey pub = ki.getPublicKey();
! return new Identity(core, repository, signer, logger, receiver, pub); }
}
--- 468,473 ----
KeyInfo ki = new KeyInfo(allowElement.element(XMLSecTools.createQName("KeyInfo")));
PublicKey pub = ki.getPublicKey();
! return new Identity(core, repository, signer, logger, receiver, pub);
! }
}
|