public static AuthenticationInfo extractAuthenticationInfo(String login, String encodedPassword) {
    try {
      char[] clearPwd;
      if (encodedPassword != null && !encodedPassword.isEmpty()) {
        clearPwd = decodePassword(encodedPassword);
      } else {
        clearPwd = null;
      }
      if (clearPwd == null) {
        clearPwd = new char[0];
      }
      String decodedLogin = URLDecoder.decode(login, "UTF-8");
      return new AuthenticationInfo(decodedLogin, clearPwd);
    } catch (GeneralSecurityException ex) {
      Logger.getLogger(OfficeOnline.class.getName()).log(Level.SEVERE, "can't retrieve credentials", ex);
      System.exit(-1);
    } catch (UnsupportedEncodingException ex) {
      Logger.getLogger(OfficeOnline.class.getName()).log(Level.SEVERE, "can't retrieve credentials", ex);
      System.exit(-1);
    }
    return null;
  }