public void update(Map userCredentials) throws AuthenticationException {
      if (passwordFile == null)
         throw new AuthenticationException("update()", new IllegalStateException());

      try {
         String userName = (String) userCredentials.get(Registry.SASL_USERNAME);
         String password = (String) userCredentials.get(Registry.SASL_PASSWORD);
         String salt =     (String) userCredentials.get(SRPRegistry.SALT_FIELD);
         String config =   (String) userCredentials.get(SRPRegistry.CONFIG_NDX_FIELD);
         if (salt == null || config == null) {
            passwordFile.changePasswd(userName, password);
         } else {
            passwordFile.add(userName, password, Util.fromBase64(salt), config);
         }
      } catch (Exception x) {
         if (x instanceof AuthenticationException) {
            throw (AuthenticationException) x;
         }
         throw new AuthenticationException("update()", x);
      }
   }