Examples of TrustEquivalence


Examples of net.jini.security.proxytrust.TrustEquivalence

    return false;
      }
      RemoteMethodControl act =
    (RemoteMethodControl) ((ConstrainableAID) obj).activator;
      MethodConstraints mc = act.getConstraints();
      TrustEquivalence trusted =
    (TrustEquivalence) activator.setConstraints(mc);
      return trusted.checkTrustEquivalence(act);
  }
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

      inputServer = (RemoteMethodControl) ((LookupSimulatorProxy) obj).server;
  } else {
      return false;
  }

  TrustEquivalence trustEquiv = (TrustEquivalence)
      server.setConstraints(inputServer.getConstraints());
  return trustEquiv.checkTrustEquivalence(inputServer);
    }
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

        final MethodConstraints mConstraints
                                        = inputProxy.getConstraints();
        /* Create a copy of the canonical proxy with its method constraints
         * replaced with the method constraints of the input proxy.
         */
        final TrustEquivalence constrainedInnerProxy =
             (TrustEquivalence)innerProxy.setConstraints(mConstraints);
        /* With respect to trust, content, and function, test whether the
         * input proxy is equivalent to the canonical inner proxy that has
         * the same method constraints as that input proxy, and verify that
         * the canonical ID of the backend server is equivalent to the ID
         * extracted from the input proxy; return the result.
         */
        return (    constrainedInnerProxy.checkTrustEquivalence(inputProxy)
                 && proxyID.equals(inputProxyID) );
    }//end isTrustedObject
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

    return false;
      }
      RemoteMethodControl otherServerProxy =
    (RemoteMethodControl) ((ConstrainableProxy) obj).serverProxy;
      MethodConstraints mc = otherServerProxy.getConstraints();
      TrustEquivalence trusted =
    (TrustEquivalence) serverProxy.setConstraints(mc);
      return trusted.checkTrustEquivalence(otherServerProxy);
  }
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

    obj);
      return false;
  }

  MethodConstraints mc = otherServerProxy.getConstraints();
  TrustEquivalence trusted =
      (TrustEquivalence) serverProxy.setConstraints(mc);
  boolean result = trusted.checkTrustEquivalence(otherServerProxy);
  logger.exiting(ProxyVerifier.class.getName(), "isTrustedObject",
      Boolean.valueOf(result));
  return result;
    }
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

      !(proxyID.equals(inputProxyID))) {
      return false;
  }

  MethodConstraints mc = otherServerProxy.getConstraints();
  TrustEquivalence trusted =
      (TrustEquivalence) serverProxy.setConstraints(mc);
  boolean result = trusted.checkTrustEquivalence(otherServerProxy);
  if (logger.isLoggable(Level.FINER)) {
      logger.exiting(proxyVerifierSourceClass, "isTrustedObject",
          Boolean.valueOf(result));
  }
  return result;
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

        FakeObjectEndpoint oe1 = new FakeObjectEndpoint();
        FakeObjectEndpoint oe2 = new FakeTrustedObjectEndpoint(false);
        FakeObjectEndpoint oe3 = new FakeTrustedObjectEndpoint(true);
        BasicInvocationHandler handler1;
        BasicInvocationHandler handler2;
        TrustEquivalence proxy1;
        TrustEquivalence proxy2;

        for (int i = 0; i < cases.length; i++) {
            proxyInterfaces1 = (Class[])cases[i][0];
            client1 = (InvocationConstraint[])cases[i][1];
            server1 = (InvocationConstraint[])cases[i][2];

            for (int j = 0; j < cases.length; j++) {
                proxyInterfaces2 = (Class[])cases[j][0];
                client2 = (InvocationConstraint[])cases[j][1];
                server2 = (InvocationConstraint[])cases[j][2];

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    + ",ObjectEndpoint doesn't implement TrustEquivalence");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe1,client1,server1);
                handler2 = newHandler(oe1,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                // verify BasicInvocationHandler.invoke test cases
                assertion(! proxy1.checkTrustEquivalence(proxy2));
                assertion(! proxy2.checkTrustEquivalence(proxy1));
                // verify BasicInvocationHandler test cases
                assertion(! handler1.checkTrustEquivalence(handler2));
                assertion(! handler2.checkTrustEquivalence(handler1));

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    +",ObjectEndpoint.checkTrustEquivalence returns false");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe2,client1,server1);
                handler2 = newHandler(oe2,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                // verify BasicInvocationHandler.invoke test cases
                assertion(! proxy1.checkTrustEquivalence(proxy2));
                assertion(! proxy2.checkTrustEquivalence(proxy1));
                // verify BasicInvocationHandler test cases
                assertion(! handler1.checkTrustEquivalence(handler2));
                assertion(! handler2.checkTrustEquivalence(handler1));

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    + ",ObjectEndpoint.checkTrustEquivalence returns true");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe3,client1,server1);
                handler2 = newHandler(oe3,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                if (i == j) {
                    // verify BasicInvocationHandler.invoke test cases
                    assertion(proxy1.checkTrustEquivalence(proxy2));
                    assertion(proxy2.checkTrustEquivalence(proxy1));
                    // verify BasicInvocationHandler test cases
                    assertion(handler1.checkTrustEquivalence(handler2));
                    assertion(handler2.checkTrustEquivalence(handler1));
                } else {
                    // verify BasicInvocationHandler.invoke test cases
                    assertion(! proxy1.checkTrustEquivalence(proxy2));
                    assertion(! proxy2.checkTrustEquivalence(proxy1));
                    // verify BasicInvocationHandler test cases
                    assertion(! handler1.checkTrustEquivalence(handler2));
                    assertion(! handler2.checkTrustEquivalence(handler1));
                }
            }//inner for loop
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

            .getInstance(host,port,principal);
        if (!(kEndpoint instanceof TrustEquivalence)) {
            throw new TestException(
                kEndpoint + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint1 = (TrustEquivalence) kEndpoint;
        //Create a second endpoint instance passing in the same host and
        //port.
        KerberosEndpoint kEndpoint2 = KerberosEndpoint
            .getInstance(host,port,principal);
        if (!(kEndpoint2 instanceof TrustEquivalence)) {
            throw new TestException(
                kEndpoint2 + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint2 = (TrustEquivalence) kEndpoint2;
        //Verify TrustEquivalence
        if (!endpoint1.checkTrustEquivalence(endpoint2) ||
            !endpoint2.checkTrustEquivalence(endpoint1)) {
            throw new TestException("TrustEquivalence not"
                + " established on equivalent endpoints.");
        }
        //Create an endpoint instance with the same host and a
        //different port
        KerberosEndpoint kEndpoint3 = KerberosEndpoint
            .getInstance(host,port2,principal);
        if (!(kEndpoint3 instanceof TrustEquivalence)) {
            throw new TestException(
                kEndpoint3 + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint3 = (TrustEquivalence) kEndpoint3;
        //Verify TrustEquivalence
        if (endpoint1.checkTrustEquivalence(endpoint3) ||
            endpoint3.checkTrustEquivalence(endpoint1)) {
            throw new TestException("TrustEquivalence"
                + " established on non-equivalent endpoints.");
        }
        //Create an endpoint instance with the same port and a
        //different host
        KerberosEndpoint kEndpoint4 = KerberosEndpoint
            .getInstance(host2,port,principal);
        if (!(kEndpoint4 instanceof TrustEquivalence)) {
            throw new TestException(
                kEndpoint4 + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint4 = (TrustEquivalence) kEndpoint4;
        //Verify TrustEquivalence
        if (endpoint1.checkTrustEquivalence(endpoint4) ||
            endpoint4.checkTrustEquivalence(endpoint1)) {
                throw new TestException("TrustEquivalence"
                    + " established on non-equivalent endpoints.");
        }
        //Create endpoint instances passing in a host, port,
        //and socket factory that does not implement TrustEquivalence.
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

            c, new Object[]{host, new Integer(port)});
        if (!(obj instanceof TrustEquivalence)) {
            throw new TestException(
                obj + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint1 = (TrustEquivalence) obj;
        //Create a second endpoint instance passing in the same host and
        //port.
        obj = getInstance2Arg.invoke(
            c, new Object[]{host, new Integer(port)});
        if (!(obj instanceof TrustEquivalence)) {
            throw new TestException(
                obj + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint2 = (TrustEquivalence) obj;
        //Verify TrustEquivalence
        if (!endpoint1.checkTrustEquivalence(endpoint2) ||
            !endpoint2.checkTrustEquivalence(endpoint1)) {
            throw new TestException("TrustEquivalence not"
                + " established on equivalent endpoints.");
        }
        //Create an endpoint instance with the same host and a
        //different port
        obj = getInstance2Arg.invoke(
            c, new Object[]{host, new Integer(port2)});
        if (!(obj instanceof TrustEquivalence)) {
            throw new TestException(
                obj + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint3 = (TrustEquivalence) obj;
        //Verify TrustEquivalence
        if (endpoint1.checkTrustEquivalence(endpoint3) ||
            endpoint3.checkTrustEquivalence(endpoint1)) {
            throw new TestException("TrustEquivalence"
                + " established on non-equivalent endpoints.");
        }
        //Create an endpoint instance with the same port and a
        //different host
        obj = getInstance2Arg.invoke(
            c, new Object[]{host2, new Integer(port)});
        if (!(obj instanceof TrustEquivalence)) {
            throw new TestException(
                obj + " does not implement TrustEquivalence");
        }
        TrustEquivalence endpoint4 = (TrustEquivalence) obj;
        //Verify TrustEquivalence
        if (endpoint1.checkTrustEquivalence(endpoint4) ||
            endpoint4.checkTrustEquivalence(endpoint1)) {
            throw new TestException("TrustEquivalence"
                + " established on non-equivalent endpoints.");
        }
        //Create endpoint instances passing in a host, port,
        //and socket factory that does not implement TrustEquivalence.
View Full Code Here

Examples of net.jini.security.proxytrust.TrustEquivalence

                return false;
            }
            RemoteMethodControl otherServerProxy =
                (RemoteMethodControl) ((ConstrainableCybernodeProxy)obj).cybernodeProxy;
            MethodConstraints mc = otherServerProxy.getConstraints();
            TrustEquivalence trusted = (TrustEquivalence) serverProxy.setConstraints(mc);
            return(trusted.checkTrustEquivalence(otherServerProxy));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.