Search in sources :

Example 41 with Debug

use of com.sun.identity.shared.debug.Debug in project OpenAM by OpenRock.

the class JCECrypt method createInstance.

private static AMEncryption createInstance(String password) {
    AMEncryption instance;
    // Construct the encryptor class
    String encClass = System.getProperty(ENCRYPTOR_CLASS_PROPERTY, DEFAULT_ENCRYPTOR_CLASS);
    try {
        instance = Class.forName(encClass).asSubclass(AMEncryption.class).newInstance();
    } catch (Exception e) {
        Debug debug = Debug.getInstance("amSDK");
        debug.error("JCECrypt.createInstance Unable to get class instance: " + encClass + ", falling back to the" + " default implementation: " + DEFAULT_ENCRYPTOR_CLASS, e);
        instance = new JCEEncryption();
    }
    try {
        ((ConfigurableKey) instance).setPassword(password);
    } catch (Exception e) {
        Debug debug = Debug.getInstance("amSDK");
        if (debug != null) {
            debug.error("JCECrypt.createInstance: failed to set password-based key", e);
        }
    }
    return instance;
}
Also used : AMEncryption(com.iplanet.services.util.AMEncryption) JCEEncryption(com.iplanet.services.util.JCEEncryption) ConfigurableKey(com.iplanet.services.util.ConfigurableKey) IOException(java.io.IOException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Debug(com.sun.identity.shared.debug.Debug)

Example 42 with Debug

use of com.sun.identity.shared.debug.Debug in project OpenAM by OpenRock.

the class ResourceEnvIPConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    condition = new ResourceEnvIPCondition(debug);
    token = mock(SSOToken.class);
    subject = new Subject();
    subject.getPrivateCredentials().add(token);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) Debug(com.sun.identity.shared.debug.Debug) Subject(javax.security.auth.Subject) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 43 with Debug

use of com.sun.identity.shared.debug.Debug in project OpenAM by OpenRock.

the class SessionConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    coreWrapper = mock(CoreWrapper.class);
    timeService = mock(TimeService.class);
    condition = new SessionCondition(debug, coreWrapper, timeService);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) TimeService(org.forgerock.util.time.TimeService) SessionCondition(org.forgerock.openam.entitlement.conditions.environment.SessionCondition) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 44 with Debug

use of com.sun.identity.shared.debug.Debug in project OpenAM by OpenRock.

the class LEAuthLevelConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    authUtils = mock(CoreWrapper.class);
    condition = new LEAuthLevelCondition(debug, authUtils);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 45 with Debug

use of com.sun.identity.shared.debug.Debug in project OpenAM by OpenRock.

the class AuthenticateToRealmConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    coreWrapper = mock(EntitlementCoreWrapper.class);
    condition = new AuthenticateToRealmCondition(debug, coreWrapper);
}
Also used : Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Debug (com.sun.identity.shared.debug.Debug)50 BeforeMethod (org.testng.annotations.BeforeMethod)15 IOException (java.io.IOException)14 ByteString (org.forgerock.opendj.ldap.ByteString)10 FileNotFoundException (java.io.FileNotFoundException)8 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)7 NoSuchPaddingException (javax.crypto.NoSuchPaddingException)7 HashSet (java.util.HashSet)6 LdapException (org.forgerock.opendj.ldap.LdapException)6 BufferedReader (java.io.BufferedReader)5 File (java.io.File)5 Subject (javax.security.auth.Subject)5 CoreWrapper (org.forgerock.openam.core.CoreWrapper)5 Test (org.testng.annotations.Test)5 StringReader (java.io.StringReader)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 SSOToken (com.iplanet.sso.SSOToken)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ArrayList (java.util.ArrayList)3 ZipFile (java.util.zip.ZipFile)3