Package org.apache.qpid.server.security

Examples of org.apache.qpid.server.security.FileTrustStoreImpl


        when(broker.getObjectFactory()).thenReturn(factory);
        when(broker.getModel()).thenReturn(factory.getModel());
        TaskExecutor executor = new CurrentThreadTaskExecutor();
        when(broker.getTaskExecutor()).thenReturn(executor);

        final FileTrustStore trustStore = new FileTrustStoreImpl(attributes, broker);
        trustStore.open();
        assertNotNull("Trust store configured object is not created", trustStore);
        assertEquals(id, trustStore.getId());

        Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), new PrivilegedAction<Object>()
        {
            @Override
            public Object run()
            {
                //verify we can retrieve the actual password using the method
                assertEquals(TestSSLConstants.BROKER_TRUSTSTORE_PASSWORD, trustStore.getPassword());
                assertNotNull(trustStore.getPassword());
                //verify that we haven't configured the trust store with the actual dummy password value
                assertFalse(AbstractConfiguredObject.SECURED_STRING_VALUE.equals(trustStore.getPassword()));
                return null;
            }
        });


        // Verify the remaining attributes, including that the password value returned
        // via getAttribute is actually the dummy value and not the real password
        attributesCopy.put(FileTrustStore.PASSWORD, AbstractConfiguredObject.SECURED_STRING_VALUE);
        for (Map.Entry<String, Object> attribute : attributesCopy.entrySet())
        {
            Object attributeValue = trustStore.getAttribute(attribute.getKey());
            assertEquals("Unexpected value of attribute '" + attribute.getKey() + "'", attribute.getValue(), attributeValue);
        }
    }
View Full Code Here


        {
            Map<String, Object> properties =  new HashMap<String, Object>(attributes);
            properties.remove(mandatoryProperties[i]);
            try
            {
                TrustStore trustStore = new FileTrustStoreImpl(properties, broker);
                trustStore.open();
                fail("Cannot create key store without a " + mandatoryProperties[i]);
            }
            catch(IllegalArgumentException e)
            {
                // pass
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.FileTrustStoreImpl

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.