 internal class RegistrationManager {
     private var appId:AppID
     internal var preferenceManager:PreferenceManager
-    
+
     internal static let logger = Logger.logger(name: AppIDConstants.RegistrationManagerLoggerName)
     
     
-    internal init(oauthManager:OAuthManager)
-    {
+    internal init(oauthManager:OAuthManager) {
         self.appId = oauthManager.appId
         self.preferenceManager = oauthManager.preferenceManager
     }

    internal func privateKeyExist() -> Bool {
        do {
            try SecurityUtils.getKeyRefFromKeyChain(AppIDConstants.privateKeyIdentifier)
            return true;
        } catch {
            return false;
        }
    }
    

    public func ensureRegistered(callback : @escaping (AppIDError?) -> Void) {
        let storedClientId:String? = self.getRegistrationDataString(name: AppIDConstants.client_id_String)
        let storedTenantId:String? = self.preferenceManager.getStringPreference(name: AppIDConstants.tenantPrefName).get()
        if storedClientId != nil && self.appId.tenantId == storedTenantId && privateKeyExist() {
            RegistrationManager.logger.debug(message: "OAuth client is already registered.")
            callback(nil)
        } else {
