Package net.jini.security

Examples of net.jini.security.AuthenticationPermission$Data


    /**
     * Return an instance with the given target and connect+listen actions.
     */
    public static AuthenticationPermission clp(String name) {
  return new AuthenticationPermission(name, "connect,listen");
    }
View Full Code Here


    /**
     * Return an instance with the given target and delegate+listen actions.
     */
    public static AuthenticationPermission dlp(String name) {
  return new AuthenticationPermission(name, "delegate,listen");
    }
View Full Code Here

     * Check that the string is not a valid target.
     */
    public static void bad(String name, String why) throws Exception {
  check(new AP(name, "connect"), why);
  try {
      new AuthenticationPermission(name, "connect");
  } catch (IllegalArgumentException e) {
      if (why.equals(e.getMessage())) {
    return;
      }
      throw e;
View Full Code Here

    /**
     * Return an instance with the given action.
     */
    public static AuthenticationPermission act(String action) {
  return new AuthenticationPermission("c \"n\"", action);
    }
View Full Code Here

  if (sm != null) {
      Set localps = Collections.singleton(local);
      Set peerps = null;
      if (peer != null)
    peerps = Collections.singleton(peer);
      AuthenticationPermission perm =
    new AuthenticationPermission(localps, peerps, action);
      sm.checkPermission(perm);
  }
    }
View Full Code Here

                   String action)
    {
  Set server = Collections.singleton(cert.getSubjectX500Principal());
  Set client = (peer == null)
      ? null : Collections.singleton(new X500Principal(peer));
  return new AuthenticationPermission(server, client, action);
    }
View Full Code Here

      this.doAsSubject = doAsSubject != null ? doAsSubject :
    Subject.getSubject(AccessController.getContext());
      if (permsToRunWith != null) {
    this.permsToRunWith = permsToRunWith;
      } else {
    AuthenticationPermission authPerm;
    if (serverPrincipal != null) {
        authPerm = new AuthenticationPermission(
      Collections.singleton(serverPrincipal), null,
      "listen");
    } else {
        authPerm = new AuthenticationPermission(
      "javax.security.auth.kerberos.KerberosPrincipal \"*\"",
      "listen");
    }
    this.permsToRunWith = new Permission[] {
        new AuthPermission("doAs"),
View Full Code Here

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

      // add in the "connect/delegate" auth permissions
      int i = basePerms.length;
      for (Iterator iter = allowedSps.iterator(); iter.hasNext();) {
    Set spset = Collections.singleton(iter.next());
    clientPerms[i++] = new AuthenticationPermission(
        allowedCps, spset, action);
      }
      return clientPerms;
  }
View Full Code Here

           allowedCps.size()];
      System.arraycopy(basePerms, 0, serverPerms, 0, basePerms.length);

      // add in the "listen" auth permission
      serverPerms[basePerms.length] =
          new AuthenticationPermission(allowedSps, null, "listen");

      // add in the "accept" auth permissions
      int i = basePerms.length + 1;
      for (Iterator iter = allowedCps.iterator(); iter.hasNext();) {
    Set cpset = Collections.singleton(iter.next());
    serverPerms[i++] = new AuthenticationPermission(
        allowedSps, cpset, "accept");
      }

      return serverPerms;
  }
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.