Package net.jini.security

Examples of net.jini.security.AuthenticationPermission$Data


      this.serverEndpoint = serverEndpoint;

      if (permsToRunWith != null) {
    this.permsToRunWith = permsToRunWith;
      } else {
    AuthenticationPermission authPerm =
        new AuthenticationPermission(
      Collections.singleton(serverEndpoint.getPrincipal()),
      null, "listen");
    this.permsToRunWith = new Permission[] {
        new AuthPermission("getSubject"),
        new SocketPermission("*:1024-", "accept,connect,listen"),
View Full Code Here


      int delegNoStepsFromSuccess = 2;
      KerberosPrincipal delegNoCp = null;

      HashMap hasPermMap = new HashMap();
      for (int i = 0; i < configs.length; i++) {
    AuthenticationPermission perm = getAuthenticationPermission(
        configs[i].clientPrincipal, configs[i].deleg);
    Boolean hasPerm = (Boolean) hasPermMap.get(perm);
    if (hasPerm == null) {
        try {
      KerberosUtil.checkAuthPermission(perm);
View Full Code Here

      } else {
    act = "connect";
      }
      Set locals = Collections.singleton(client);
      Set peers = Collections.singleton(serverPrincipal);
      return new AuthenticationPermission(locals, peers, act);
  }
View Full Code Here

    // allow the simulator, running as reggie, to authenticate as reggie
    // XXX Should the permission be obtained from the configuration???
    Security.grant(lookupProxy.getClass(),
             new Principal[]{reggie},
             new Permission[] {
           new AuthenticationPermission(
             Collections.singleton(reggie),
             Collections.singleton(reggie),
             "connect")});
    context.login();
      } catch (LoginException e) {
View Full Code Here

    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

TOP

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

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.