/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2017-2020, Regents of the University of California.
 *
 * This file is part of ndncert, a certificate management system based on NDN.
 *
 * ndncert is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received copies of the GNU General Public License along with
 * ndncert, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 *
 * See AUTHORS.md for complete list of ndncert authors and contributors.
 */

#ifndef NDNCERT_PROTOCOL_DETAIL_PROBE_ENCODER_HPP
#define NDNCERT_PROTOCOL_DETAIL_PROBE_ENCODER_HPP

#include "../configuration.hpp"

namespace ndn {
namespace ndncert {

class ProbeEncoder
{
public:
  // For Client use
  static Block
  encodeApplicationParameters(std::vector<std::tuple<std::string, std::string>>&& parameters);

  static void
  decodeDataContent(const Block& block, std::vector<std::pair<Name, int>>& availableNames,
                    std::vector<Name>& availableRedirection);

  // For CA use
  static Block
  encodeDataContent(const std::vector<Name>& identifiers,
                    boost::optional<size_t> maxSuffixLength = boost::none,
                    boost::optional<std::vector<std::shared_ptr<security::Certificate>>> redirectionItems = boost::none);

  static std::vector<std::tuple<std::string, std::string>>
  decodeApplicationParameters(const Block& block);
};

} // namespace ndncert
} // namespace ndn

#endif // NDNCERT_PROTOCOL_DETAIL_PROBE_ENCODER_HPP