Package javax.management.remote

Examples of javax.management.remote.JMXPrincipal


    private SslSocketHelper() {
    }

    public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth)
        throws IOException {
        JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
        X509Certificate cert = new StubX509Certificate(principal);
        StubSSLSession sslSession = new StubSSLSession(cert);

        StubSSLSocket sslSocket = new StubSSLSocket(sslSession);
        sslSocket.setWantClientAuth(wantAuth);
View Full Code Here


        if (authenticated)
        {
            //credential's check out, return the appropriate JAAS Subject
            return new Subject(true,
                    Collections.singleton(new JMXPrincipal(username)),
                    Collections.EMPTY_SET,
                    Collections.EMPTY_SET);
        }
        else
        {
View Full Code Here

        assertEquals(1, principals.size());

        Object ref = principals.iterator().next();
        assertTrue(ref instanceof JMXPrincipal);

        JMXPrincipal jmxPrincipal = (JMXPrincipal) ref;
        String name = jmxPrincipal.getName();
        assertNotNull(name);
        assertEquals(VALID_AUTH_TOKEN[0], name);
    }
View Full Code Here

            ((Map) sharedState).put(USERNAME_KEY, username);
            ((Map) sharedState).put(PASSWORD_KEY, password);
        }

        // Create a new user principal
        user = new JMXPrincipal(username);

        if (logger.debugOn()) {
            logger.debug("login",
                "User '" + username + "' successfully validated");
        }
View Full Code Here

    private SslSocketHelper() {
    }

    public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth)
        throws IOException {
        JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
        X509Certificate cert = new StubX509Certificate(principal);
        StubSSLSession sslSession = new StubSSLSession(cert);

        StubSSLSocket sslSocket = new StubSSLSocket(sslSession);
        sslSocket.setWantClientAuth(wantAuth);
View Full Code Here

        if (!isPasswordCorrect(password, storedPassword)) {
            throw new SecurityException("Bad password");
        }

        Set principals = new HashSet();
        principals.add(new JMXPrincipal(user));
        return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
    }
View Full Code Here

        _plainPd = new PlainPasswordFilePrincipalDatabase();
        _plainPwdFile = createTempPasswordFile(this.getClass().getName()+"plainpwd", USERNAME, PASSWORD);
        _plainPd.setPasswordFile(_plainPwdFile.getAbsolutePath());
       
        testSubject = new Subject(true,
                Collections.singleton(new JMXPrincipal(USERNAME)),
                Collections.EMPTY_SET,
                Collections.EMPTY_SET);
    }
View Full Code Here

        if (authenticated)
        {
            //credential's check out, return the appropriate JAAS Subject
            return new Subject(true,
                    Collections.singleton(new JMXPrincipal(username)),
                    Collections.EMPTY_SET,
                    Collections.EMPTY_SET);
        }
        else
        {
View Full Code Here

      String storedPassword = (String)passwords.get(user);
      if (!isPasswordCorrect(password, storedPassword)) throw new SecurityException("Bad password");

      Set principals = new HashSet();
      principals.add(new JMXPrincipal(user));
      return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
   }
View Full Code Here

     * Tests a successful authentication.  Ensures that a populated read-only subject it returned.
     */
    public void testAuthenticationSuccess()
    {
        final Subject expectedSubject = new Subject(true,
                Collections.singleton(new JMXPrincipal(USERNAME)),
                Collections.EMPTY_SET,
                Collections.EMPTY_SET);

        _rmipa.setAuthenticationManager(createTestAuthenticationManager(true, null));

View Full Code Here

TOP

Related Classes of javax.management.remote.JMXPrincipal

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.