예제 #1
0
        /**
         * Changes the password associated with the security artifacts used to provide data encryption.
         */
        public static bool changeCurrentPassword(string oldPassword, string newPassword, string username)
        {
            // get the shared manager
            JSONStoreSQLLite store = JSONStoreSQLLite.sharedManager();

            if (store == null)
            {
                //JSONStoreLoggerError(@"Error: JSON_STORE_DATABASE_NOT_OPEN, code: %d", rc);
                throw new JSONStoreException(JSONStoreConstants.JSON_STORE_DATABASE_NOT_OPEN);
            }

            bool worked = store.changePassword(oldPassword, newPassword, username);

            if (!worked)
            {
                //JSONStoreLoggerError(@"Error: JSON_STORE_ERROR_CHANGING_PASSWORD, code: %d, username: %@, newPwdLength: %d, oldPwdLength: %d", rc, username, [newPassword length], [oldPassword length]);
                throw new JSONStoreException(JSONStoreConstants.JSON_STORE_ERROR_CHANGING_PASSWORD);
            }

            return(worked);
        }