Package net.jini.security

Examples of net.jini.security.AuthenticationPermission$AuthenticationPermissionCollection


    continue;
      } else if (context.server == UNKNOWN_PRINCIPAL) {
    /* Server not known -- can't check any permissions */
    break;
      }
      AuthenticationPermission p = new AuthenticationPermission(
    Collections.singleton(context.client),
    Collections.singleton(context.server),
    "connect");
      Object value = perms.get(p);
      if (Boolean.FALSE.equals(value)) {
View Full Code Here


     */
    void checkAuthenticationPermission(X500Principal principal, String action)
    {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
      sm.checkPermission(new AuthenticationPermission(
    Collections.singleton(principal), null, action));
  }
    }
View Full Code Here

  PermissionCollection permissions = new Permissions();
  for (int i = 0; i < perms.length; i++) {
      permissions.add(perms[i]);
  }
  if (isKerberos) {
      permissions.add(new AuthenticationPermission("* \"*\"", "connect"));
  }
  AccessControlContext acc = new AccessControlContext(
            new ProtectionDomain[] {
            new ProtectionDomain(null, permissions),
  });
View Full Code Here

  String name = TestPrincipal.class.getName() + " \"local\" peer " +
      TestPrincipal.class.getName() + " \"peer\"";
  String actions = "listen, accept, delegate";
  defaultPermsNoSocketPerm = new Permission[] {
      new TestPermission("testPermission"),
      new AuthenticationPermission(name, actions),
      new AuthPermission("doAs"), // needed for newRequest()
      // so provider will throw detailed exception instead of generic one
      new AuthPermission("getSubject")
  };
  defaultPermsWithSocketPerm = new Permission[] {
      new TestPermission("testPermission"),
      new AuthenticationPermission(name, actions),
      new AuthPermission("doAs"), // needed for newRequest()
      // so provider will throw detailed exception instead of generic one
      new AuthPermission("getSubject"),
      new SocketPermission("*:1024-", "accept,connect,listen")
  };
View Full Code Here

  Permission[] sockPermOnly = new Permission[] {
      new SocketPermission("*:1024-", "accept,connect,listen"),
  };

  Permission[] authPermOnly = new Permission[] {
      new AuthenticationPermission(
    Collections.singleton(defaultServerPrincipal), null, "listen")
  };

  /*
  Permission[] withTestClient3AuthPerms = new Permission[] {
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        AuthenticationPermission ap = new AuthenticationPermission(
                "abc \"abc\"", "listen");
        logger.fine("Calling 'newPermissionCollection' of " + ap + ".");
        PermissionCollection pc = ap.newPermissionCollection();

        if (pc.elements().hasMoreElements()) {
            // FAIL
            throw new TestException(
                    "Created PermissionCollection is not empty: " + pc);
View Full Code Here

    public AuthenticationPermission createAP(Set local, Set peer,
            String actions) {
        logger.fine("Creating AuthenticationPermission with '" + local
                + "' set of local principals, '" + peer
                + "' set of peer principals and '"+ actions + "' actions.");
        return new AuthenticationPermission(local, peer, actions);
    }
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        AuthenticationPermission ap = createAP("abc \"abc\"",
                "accept, delegate");
        boolean res = implies(ap, null);

        if (res) {
            // FAIL
View Full Code Here

     * @param actions 2-nd parameter for AuthenticationPermission constructor
     * @return created AuthenticationPermission instance
     * @throws rethrow any exception thrown by constructor
     */
    public AuthenticationPermission createAP(String name, String actions) {
        return new AuthenticationPermission(name, actions);
    }
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        AuthenticationPermission ap = createAP("abc \"abc\"",
                "accept, delegate");
        boolean res = equals(ap, null);

        if (res) {
            // FAIL
View Full Code Here

TOP

Related Classes of net.jini.security.AuthenticationPermission$AuthenticationPermissionCollection

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.