Search in sources :

Example 1 with AMKeyProvider

use of org.forgerock.openam.utils.AMKeyProvider in project OpenAM by OpenRock.

the class SigProviderTest method setUp.

@BeforeClass
public void setUp() {
    // The keystore properties required to bootstrap this class are setup in the POM
    keyProvider = new AMKeyProvider();
    sigProvider = SigManager.getSigInstance();
}
Also used : AMKeyProvider(org.forgerock.openam.utils.AMKeyProvider) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with AMKeyProvider

use of org.forgerock.openam.utils.AMKeyProvider in project OpenAM by OpenRock.

the class PersistentCookieAuthModuleTest method setUp.

@BeforeMethod
public void setUp() {
    jwtSessionModule = mock(ServletJwtSessionModule.class);
    amKeyProvider = mock(AMKeyProvider.class);
    amLoginModuleBinder = mock(AMLoginModuleBinder.class);
    coreWrapper = mock(CoreWrapper.class);
    persistentCookieAuthModule = new PersistentCookieAuthModule(jwtSessionModule, amKeyProvider, coreWrapper) {

        @Override
        protected String getKeyAlias(String orgName) throws SSOException, SMSException {
            return "KEY_ALIAS";
        }
    };
    persistentCookieAuthModule.setAMLoginModule(amLoginModuleBinder);
    given(amKeyProvider.getPrivateKeyPass()).willReturn("PRIVATE_KEY_PASS");
    given(amKeyProvider.getKeystoreType()).willReturn("KEYSTORE_TYPE");
    given(amKeyProvider.getKeystoreFilePath()).willReturn("KEYSTORE_FILE_PATH");
    given(amKeyProvider.getKeystorePass()).willReturn("KEYSTORE_PASS".toCharArray());
    HttpServletRequest request = mock(HttpServletRequest.class);
    HttpServletResponse response = mock(HttpServletResponse.class);
    given(amLoginModuleBinder.getHttpServletRequest()).willReturn(request);
    given(amLoginModuleBinder.getHttpServletResponse()).willReturn(response);
    given(amLoginModuleBinder.getRequestOrg()).willReturn("REQUEST_ORG");
}
Also used : AMKeyProvider(org.forgerock.openam.utils.AMKeyProvider) HttpServletRequest(javax.servlet.http.HttpServletRequest) CoreWrapper(org.forgerock.openam.core.CoreWrapper) SMSException(com.sun.identity.sm.SMSException) AMLoginModuleBinder(org.forgerock.openam.authentication.modules.common.AMLoginModuleBinder) HttpServletResponse(javax.servlet.http.HttpServletResponse) ServletJwtSessionModule(org.forgerock.jaspi.modules.session.jwt.ServletJwtSessionModule) SSOException(com.iplanet.sso.SSOException) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with AMKeyProvider

use of org.forgerock.openam.utils.AMKeyProvider in project OpenAM by OpenRock.

the class XMLSignatureManagerTest method setUp.

@BeforeClass
public void setUp() {
    KeyProvider keyProvider = new AMKeyProvider(true, KEY_STORE_FILE, KEY_STORE_PASS, KEY_STORE_TYPE, DEFAULT_PRIVATE_KEY_PASS);
    SignatureProvider signatureProvider = new AMSignatureProvider();
    xmlSignatureManager = XMLSignatureManager.getInstance(keyProvider, signatureProvider);
}
Also used : AMKeyProvider(org.forgerock.openam.utils.AMKeyProvider) AMKeyProvider(org.forgerock.openam.utils.AMKeyProvider) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

AMKeyProvider (org.forgerock.openam.utils.AMKeyProvider)3 BeforeClass (org.testng.annotations.BeforeClass)2 SSOException (com.iplanet.sso.SSOException)1 SMSException (com.sun.identity.sm.SMSException)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 ServletJwtSessionModule (org.forgerock.jaspi.modules.session.jwt.ServletJwtSessionModule)1 AMLoginModuleBinder (org.forgerock.openam.authentication.modules.common.AMLoginModuleBinder)1 CoreWrapper (org.forgerock.openam.core.CoreWrapper)1 BeforeMethod (org.testng.annotations.BeforeMethod)1