Package net.jini.security

Examples of net.jini.security.AuthenticationPermission$Data


     *
     * @return Contentinfo with contentType Data.
     */
    private ContentInfo makeData(SafeContents safe) throws IOException,
      ASN1Exception {
  Data data = null;
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DEREncoder encoder = new DEREncoder(baos);
  safe.encode(encoder);
  data = new Data(baos.toByteArray());
  baos.close();
  ContentInfo cInfo = new ContentInfo(data);
  return cInfo;
    }
View Full Code Here


  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }

  return reply.read4(8);
    }
View Full Code Here

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
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

  Permissions 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

  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

    X509Certificate serverCert =
        getAuthManager().getServerCertificate(session);
    serverPrincipal = serverCert != null
        ? serverCert.getSubjectX500Principal() : null;
    if (serverPrincipal != null) {
        authPermission = new AuthenticationPermission(
      Collections.singleton(serverPrincipal),
      (clientPrincipal != null
       ? Collections.singleton(clientPrincipal) : null),
      "accept");
    }
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.