Examples of InvocationConstraint


Examples of net.jini.core.constraint.InvocationConstraint

        Iterator itClient = clientRequirements.iterator();
        if ((clientRequirements.isEmpty())&&(clientPreferences.isEmpty())) {
            return false;
        }
        while (itClient.hasNext()) {
            InvocationConstraint c1 = (InvocationConstraint) itClient.next();
            if (c1 == Integrity.NO) return false;
        }
        return true;
    }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

        /* combined requirements must be mutable */
        Set combinedRequirements =
        new HashSet(combinedConstraints.requirements());
        Iterator it = imposedRequirements.iterator();
        while (it.hasNext()) {
            InvocationConstraint c = (InvocationConstraint)it.next();
            if (!combinedRequirements.contains(c)) {
                logFailure("Combined constraint is missing constraint " + c);
            }
            combinedRequirements.remove(c);
        }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

     */
    private boolean imposed(InvocationConstraints constraints,
        InvocationConstraint constraint) {
        Iterator it = constraints.requirements().iterator();
        while (it.hasNext()) {
            InvocationConstraint c = (InvocationConstraint)it.next();
            if (c.equals(constraint)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

     */
    private boolean preferred(InvocationConstraints constraints,
        InvocationConstraint constraint) {
        Iterator it = constraints.preferences().iterator();
        while (it.hasNext()) {
            InvocationConstraint c = (InvocationConstraint)it.next();
            if (c.equals(constraint)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

            logger.writeLog();
            throw new TestException("Unexpected runtime exception", e);
        }

        for (Iterator it = requirements.iterator(); it.hasNext(); ) {
            InvocationConstraint c = (InvocationConstraint) it.next();
            if ((c == Confidentiality.YES) && !suite.isConfidential()) {
                logFailure("Confidentiality.YES is not supported "
                    + "by suite " + suite);
            }
            if ((c == Confidentiality.NO) && suite.isConfidential()) {
                logFailure("Confidentiality.NO is not supported "
                    + "by suite " + suite);
            }
            if ((c == ServerAuthentication.YES) && !suite.isAuthenticated()) {
                logFailure("ServerAuthentication.YES is not "
                    + "supported by suite " + suite);
            }
            if ((c == ServerAuthentication.NO) && suite.isAuthenticated()) {
                logFailure("ServerAuthentication.NO is not "
                + "supported by suite " + suite);
            }
            if ((c == ClientAuthentication.YES) && !suite.isAuthenticated()) {
                logFailure("ClientAuthentication.YES is not "
                    + "supported by suite " + suite);
            }
            if ((c == ClientAuthentication.YES) && !clientAuthenticated) {
                logFailure("ClientAuthentication.YES is asserted, "
                    + "but the client did not authenticate with the server");
            }
            if ((c == ClientAuthentication.NO) && clientAuthenticated) {
                logFailure("ClientAuthentication.NO is asserted, "
                    + "but client authenticated with the server");
            }
            if ((c == Integrity.YES) && !suite.isIntegrity()) {
                logFailure("Integrity.YES is not supported by suite " + suite);
            }
            if ((c == Integrity.NO) && suite.isIntegrity()) {
                logFailure("Integrity.NO is not supported by suite " + suite);
            }
        }

        /*
         * check preferences. Note that the ConfidentialityStrength
         * constraint may be ignored if Confidentiality.YES is not imposed
         */
        Set preferences = constraints.preferences();
        for (Iterator it = preferences.iterator(); it.hasNext(); ) {
            InvocationConstraint c = (InvocationConstraint) it.next();
            if ((c == ConfidentialityStrength.WEAK) && !suite.isWeak()
                && imposed(constraints,Confidentiality.YES)) {
                logFailure("ConfidentialityStrength.WEAK was "
                    + "preferred but a strong suite "
                    + "was selected:" + suite);
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

            if (clientSubject==null){
                boolean ok = true;
                Iterator it = method.parseConstraints().requirements()
                    .iterator();
                while (it.hasNext()) {
                    InvocationConstraint sc = (InvocationConstraint)
                    it.next();
                    if (sc == ClientAuthentication.YES) {
                        ok = false;
                    }
                }
                if (ok) {
                    return;
                }
            }
            if (ProviderManager.isKerberosProvider()) {
                boolean ok = false;
                Iterator it = method.parseConstraints().requirements()
                    .iterator();
                while (it.hasNext()) {
                    InvocationConstraint sc = (InvocationConstraint)
                    it.next();
                    if (sc == ClientAuthentication.NO) {
                        ok = true;
                    }
                }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

                new ArrayList(clientConstraints.requirements());
            Iterator itClient = clientRequirements.iterator();
            boolean gotConfidentialityNo = false;
            boolean gotServerAuthNo = false;
            while (itClient.hasNext()) {
                InvocationConstraint c1 = (InvocationConstraint) itClient.next();
                if (c1 == Integrity.NO) {
                    return "Integrity.NO applied, "
                        + "but is not supported by the JSSE provider";
                }
                if (c1 == Delegation.YES) {
                    if ((!ProviderManager.isKerberosProvider())
                        && (clientRequirements.contains(ClientAuthentication.YES)
                        || serverRequirements
                        .contains(ClientAuthentication.YES))) {
                        return "ClientAuthentication.YES and Delegation.YES "
                            + "cannot be simultaneously supported by JSSE";
                    }
                }
                Iterator itServ = serverRequirements.iterator();
                if (c1 == Confidentiality.NO) {
                    gotConfidentialityNo = true;
                }
                if (c1 == ServerAuthentication.NO) {
                    gotServerAuthNo = true;
                }

                if (c1 == ClientAuthentication.YES && method.getName()
                    .equals("vBogus")) {
                    return "vBogus should always fail because it is not "
                        + "included in the policy file";
                }
                while (itServ.hasNext()) {
                    InvocationConstraint c2 = (InvocationConstraint) itServ.next();
                    if (c2 == Integrity.NO) {
                        return "Integrity.NO applied, but is not "
                            + "supported by JSSE";
                    }
                    if (c2 == Delegation.YES) {
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

            logger.log(Level.INFO, "--> " + testCase);
           
            // 1
            String name = "someMethod";
            Class[] types = new Class[] {int.class, Object.class};
            InvocationConstraint ic = Delegation.YES;
            InvocationConstraints constraints = new InvocationConstraints(
                    ic, null);
            callConstructor(testCase, name, types, constraints);
           
            // 2
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

                || tc == CL_MIN_PR__PRINCIPAL
                || tc == SRV_MIN_PR__PRINCIPAL) {
            pr_name_before = pr.getName(X500Principal.CANONICAL);
        }

        InvocationConstraint ic = null;

        try {
            if (       tc == CL_MAX_PR__PRINCIPAL
                    || tc == CL_MAX_PR__PRINCIPAL_NULL) {
                ic = new ClientMaxPrincipal((Principal) pr);
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraint

                || tc == SRV_MIN_PR__PRINCIPALS_ARRAY) {
            pr_copy = new X500Principal[pr.length];
            System.arraycopy(pr, 0, pr_copy, 0, pr.length);
        }

        InvocationConstraint ic = null;

        try {
            if (       tc == CL_MAX_PR__PRINCIPALS_ARRAY
                    || tc == CL_MAX_PR__PRINCIPALS_NULL_ARRAY
                    || tc == CL_MAX_PR__PRINCIPALS_ARRAY_NULL_EL
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.