Package net.jini.jeri.kerberos

Examples of net.jini.jeri.kerberos.KerberosEndpoint$RequestHandleImpl


        //Obtain an instance of KerberosTrustVerifier
        KerberosTrustVerifier verifier = new KerberosTrustVerifier();
        //Verify that instances of KerberosEndpoint with no socket
        //factory are trusted.
        int port = Integer.parseInt(getStringValue("listenPort"));
        KerberosEndpoint endpoint = KerberosEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new KerberosPrincipal("test@test"));
        TestTrustVerifierCtxSSL ctx = new TestTrustVerifierCtxSSL();
        if (!verifier.isTrustedObject(endpoint,ctx)){
            throw new TestException("KerberosEndpoint instance"
View Full Code Here


     * @return The test result
     */
    private void runTest(Subject subject) throws Exception {
        KerberosPrincipal principal = (KerberosPrincipal)subject
            .getPrincipals().iterator().next();
        KerberosEndpoint endpoint = KerberosEndpoint.getInstance(host,port,
            principal);
        log.finest("Obtained endpoint instance " + endpoint);
        //Verify the host and port parameters match values used at creation
        int portVal = endpoint.getPort();
        if (portVal!=port) {
            throw new TestException("The state of the instance"
                + " does not match the state passed in at creation time."
                + " The port values are different : " + port + " " +
                portVal);
        }
        String hostVal = endpoint.getHost();
        if (hostVal.compareTo(host)!=0) {
            throw new TestException("The state of the instance"
                + " does not match the state passed in at creation time."
                + " The host values are different : " + host + " " +
                hostVal);
        }
        SocketFactory sfVal = endpoint.getSocketFactory();
        if (sfVal!=null) {
            throw new TestException("The state of the instance"
                + " does not match the state passed in at creation time."
                + " The socket factory values are different : " + sf
                + " " + sfVal);
        }
        // Call getInstance passing in a host, port and socket factory.
        endpoint = KerberosEndpoint.getInstance(host,port,principal,sf);
        //verify that the socket factory passed in is maintained
        sfVal = endpoint.getSocketFactory();
        if (sfVal!=sf) {
            throw new TestException("The state of the instance"
                + " does not match the state passed in at creation time."
                + " The socket factory values are different : " + sf
                + " " + sfVal);
View Full Code Here

    private void runTest(Subject subject) throws Exception {
        KerberosPrincipal principal = (KerberosPrincipal)subject
            .getPrincipals().iterator().next();
        //Create an endpoint instance passing in a host and port.
        KerberosEndpoint kEndpoint = KerberosEndpoint
            .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");
        }
View Full Code Here

TOP

Related Classes of net.jini.jeri.kerberos.KerberosEndpoint$RequestHandleImpl

Copyright © 2018 www.massapicom. 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.