Controller code cleanup, added rsaexception, added keystorageexception