CVS update: sierra/src/java/org/openprivacy/sierra/nym/talon/implementations

From: cvs@openprivacy.org
Date: Thu Feb 22 2001 - 21:58:41 PST

  • Next message: cvs@openprivacy.org: "CVS update: sierra/src/java/org/openprivacy/sierra/nym/talon/interfaces"

    Date: Thursday February 22, 19101 @ 21:58
    Author: burton
    CVSWEB Options: -------------------

    Main CVSWeb: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi

    View this module: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations

    -----------------------------------

    Update of /usr/local/cvs/public/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations
    In directory giga:/tmp/cvs-serv32446/src/java/org/openprivacy/sierra/nym/talon/implementations

    Modified Files:
            SimpleNymBuilder.java SimpleNymFunctionProxy.java
    Log Message:
    simple nym support should work

    *****************************************************************
    File: sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java

    CVSWEB Options: -------------------

    CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java?annotate=1.6

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java?rev=1.6&content-type=text/x-cvsweb-markup

    CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java.diff?r1=1.6&r2=1.5

    -----------------------------------

    Index: sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java
    diff -u sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java:1.5 sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java:1.6
    --- sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java:1.5 Thu Feb 22 20:37:09 2001
    +++ sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymBuilder.java Thu Feb 22 21:58:41 2001
    @@ -39,7 +39,7 @@
      * </ul>
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: SimpleNymBuilder.java,v 1.5 2001/02/23 04:37:09 burton Exp $
    + * @version $Id: SimpleNymBuilder.java,v 1.6 2001/02/23 05:58:41 burton Exp $
      */
     public class SimpleNymBuilder extends BaseComponent implements Component, NymBuilder {
     
    @@ -56,11 +56,19 @@
                                  .setImplementation( "org.openprivacy.sierra.nym.talon.implementations.SimpleNym" )
                                  .setLifetime( ComponentHandle.LIFETIME_DEMAND );
     
    + private ComponentHandle NYM_FUNCTION_PROXY_HANDLE =
    + new ComponentHandle().setInterface( "org.openprivacy.sierra.nym.talon.interfaces.NymFunctionProxy" )
    + .setImplementation( "org.openprivacy.sierra.nym.talon.implementations.SimpleNymFunctionProxy" )
    + .setLifetime( ComponentHandle.LIFETIME_DEMAND );
    +
    + private Nym nym = null;
    + private NymFunctionProxy nfp = null;
    +
         /**
          * initialize this...
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: SimpleNymBuilder.java,v 1.5 2001/02/23 04:37:09 burton Exp $
    + * @version $Id: SimpleNymBuilder.java,v 1.6 2001/02/23 05:58:41 burton Exp $
          */
         public void init() throws TalonException {
     
    @@ -72,31 +80,47 @@
         /**
          * @see NymBuilder
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: SimpleNymBuilder.java,v 1.5 2001/02/23 04:37:09 burton Exp $
    + * @version $Id: SimpleNymBuilder.java,v 1.6 2001/02/23 05:58:41 burton Exp $
          */
         public Nym getNym() throws SierraException {
     
    - NYM_HANDLE.setInitProperties( this.getComponentHandle().getInitProperties() );
    + if ( nym == null ) {
    +
    + NYM_HANDLE.setInitProperties( this.getComponentHandle().getInitProperties() );
    +
    + try {
    + nym = (Nym)ComponentFactory.getInstance( NYM_HANDLE );
    + } catch ( TalonException e ) {
    + throw new SierraException( e );
    + }
    +
    + }
             
    - try {
    - return (Nym)ComponentFactory.getInstance( NYM_HANDLE );
    - } catch ( TalonException e ) {
    - throw new SierraException( e );
    - }
    + return nym;
     
         }
     
         /**
          * @see NymBuilder
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: SimpleNymBuilder.java,v 1.5 2001/02/23 04:37:09 burton Exp $
    + * @version $Id: SimpleNymBuilder.java,v 1.6 2001/02/23 05:58:41 burton Exp $
          */
    - public NymFunctionProxy getNymFunctionProxy( Nym nym ) throws SierraException {
    + public NymFunctionProxy getNymFunctionProxy() throws SierraException {
     
    - //FIXME:
    - return null;
    + if ( nfp == null ) {
    +
    + try {
    + nfp = (NymFunctionProxy)ComponentFactory.getInstance( NYM_FUNCTION_PROXY_HANDLE );
    + nfp.setNym( this.getNym() );
    + } catch ( TalonException e ) {
    + throw new SierraException( e );
    + }
    +
    + }
    +
    + return nfp;
    +
         }
    -
         
     }
     

    *****************************************************************
    File: sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java

    CVSWEB Options: -------------------

    CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java?annotate=1.2

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java?rev=1.2&content-type=text/x-cvsweb-markup

    CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java.diff?r1=1.2&r2=1.1

    -----------------------------------

    Index: sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java
    diff -u sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java:1.1 sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java:1.2
    --- sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java:1.1 Thu Feb 22 20:37:29 2001
    +++ sierra/src/java/org/openprivacy/sierra/nym/talon/implementations/SimpleNymFunctionProxy.java Thu Feb 22 21:58:41 2001
    @@ -33,7 +33,7 @@
      * not cryptographically valid.
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: SimpleNymFunctionProxy.java,v 1.1 2001/02/23 04:37:29 burton Exp $
    + * @version $Id: SimpleNymFunctionProxy.java,v 1.2 2001/02/23 05:58:41 burton Exp $
      */
     public class SimpleNymFunctionProxy extends BaseComponent implements Component, NymFunctionProxy {
         
    @@ -46,7 +46,7 @@
     
         /**
          * @see NymFunctionProxy
    - * @version $Id: SimpleNymFunctionProxy.java,v 1.1 2001/02/23 04:37:29 burton Exp $
    + * @version $Id: SimpleNymFunctionProxy.java,v 1.2 2001/02/23 05:58:41 burton Exp $
          */
         public Nym getNym() {
             return this.nym;
    @@ -55,7 +55,7 @@
         
         /**
          * @see NymFunctionProxy
    - * @version $Id: SimpleNymFunctionProxy.java,v 1.1 2001/02/23 04:37:29 burton Exp $
    + * @version $Id: SimpleNymFunctionProxy.java,v 1.2 2001/02/23 05:58:41 burton Exp $
          */
         public void setNym( Nym nym ) {
             this.nym = nym;
    @@ -63,17 +63,15 @@
                                            
         /**
          * @see NymFunctionProxy
    - * @version $Id: SimpleNymFunctionProxy.java,v 1.1 2001/02/23 04:37:29 burton Exp $
    + * @version $Id: SimpleNymFunctionProxy.java,v 1.2 2001/02/23 05:58:41 burton Exp $
          */
         public byte[] sign( Object obj ) throws SierraException {
     
             try {
    -
    - Signature signature = Signature.getInstance( "MD5" );
    -
    - signature.update( obj.toString().getBytes() );
    +
    + MessageDigest md = MessageDigest.getInstance( "MD5" );
     
    - return signature.sign();
    + return md.digest( obj.toString().getBytes() );
                 
             } catch ( GeneralSecurityException gsa ) {
                 throw new SierraException( gsa );
    @@ -83,7 +81,7 @@
         
         /**
          * @see NymFunctionProxy
    - * @version $Id: SimpleNymFunctionProxy.java,v 1.1 2001/02/23 04:37:29 burton Exp $
    + * @version $Id: SimpleNymFunctionProxy.java,v 1.2 2001/02/23 05:58:41 burton Exp $
          */
         public byte[] encrypt( Object obj ) throws SierraException {
             throw new RuntimeException( "Not implemented yet." );



    This archive was generated by hypermail 2b30 : Thu Feb 22 2001 - 21:59:12 PST