/* -*- 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_CERTIFICATE_REQUEST_HPP
#define NDNCERT_CERTIFICATE_REQUEST_HPP

#include "ndncert-common.hpp"
#include <ndn-cxx/security/v2/certificate.hpp>
#include <boost/property_tree/info_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>

namespace ndn {
namespace ndncert {

typedef boost::property_tree::ptree JsonSection;

/**
 * @brief Represents a certificate request instance.
 *
 * ChallengeModule should take use of m_challengeStatus, m_challengeInstruction and
 * m_challengeDefinedField to finish verification.
 *
 */
class CertificateRequest {
public:
  CertificateRequest();
  CertificateRequest(const Name& caName, const std::string& requestId, RequestType requestType, Status status,
                     const security::v2::Certificate& cert);
  CertificateRequest(const Name& caName, const std::string& requestId, RequestType requestType, Status status,
                     const std::string& challengeStatus, const std::string& challengeType,
                     const std::string& challengeTp, int remainingTime, int remainingTries,
                     const JsonSection& challengeSecrets, const security::v2::Certificate& cert);

  void
  setProbeToken(const std::shared_ptr<Data>& probeToken);

public:
  Name m_caPrefix;
  std::string m_requestId = "";
  RequestType m_requestType = RequestType::NOTINITIALIZED;
  Status m_status = Status::NOT_STARTED;
  security::v2::Certificate m_cert;
  std::shared_ptr<Data> m_probeToken = nullptr;

  std::string m_challengeStatus = "";
  std::string m_challengeType = "";
  std::string m_challengeTp = "";
  int m_remainingTime = 0;
  int m_remainingTries = 0;
  JsonSection m_challengeSecrets;
};

std::ostream&
operator<<(std::ostream& os, const CertificateRequest& request);

}  // namespace ndncert
}  // namespace ndn

#endif  // NDNCERT_CERTIFICATE_REQUEST_HPP
