| /* -*- 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_REQUESTER_STATE_HPP |
| #define NDNCERT_REQUESTER_STATE_HPP |
| |
| #include "detail/ndncert-common.hpp" |
| #include "detail/crypto-helper.hpp" |
| #include "configuration.hpp" |
| |
| namespace ndn { |
| namespace ndncert { |
| |
| struct RequesterState { |
| explicit |
| RequesterState(security::KeyChain& keyChain, const CaProfile& caItem, RequestType requestType); |
| |
| /** |
| * @brief The CA profile for this request. |
| */ |
| CaProfile m_caItem; |
| /** |
| * @brief The local keychain to generate and install identities, keys and certificates |
| */ |
| security::KeyChain& m_keyChain; |
| /** |
| * @brief The type of request. Either NEW, RENEW, or REVOKE. |
| */ |
| RequestType m_type; |
| /** |
| * @brief The identity name for the requesting certificate. |
| */ |
| Name m_identityName; |
| /** |
| * @brief The keypair for the request. |
| */ |
| security::Key m_keyPair; |
| /** |
| * @brief The CA-generated request ID for the request. |
| */ |
| std::string m_requestId; |
| /** |
| * @brief The current status of the request. |
| */ |
| Status m_status = Status::NOT_STARTED; |
| /** |
| * @brief The type of challenge chosen. |
| */ |
| std::string m_challengeType; |
| /** |
| * @brief The status of the current challenge. |
| */ |
| std::string m_challengeStatus; |
| /** |
| * @brief The remaining number of tries left for the challenge |
| */ |
| int m_remainingTries = 0; |
| /** |
| * @brief The time this challenge will remain fresh |
| */ |
| time::system_clock::TimePoint m_freshBefore; |
| /** |
| * @brief the name of the certificate being issued. |
| */ |
| Name m_issuedCertName; |
| /** |
| * @brief ecdh state. |
| */ |
| ECDHState m_ecdh; |
| /** |
| * @brief AES key derived from the ecdh shared secret. |
| */ |
| uint8_t m_aesKey[16] = {0}; |
| /** |
| * @brief The counter of AES blocks that have been encrypted. |
| */ |
| uint32_t m_aesBlockCounter = 0; |
| /** |
| * @brief State about how identity/key is generated. |
| */ |
| bool m_isNewlyCreatedIdentity = false; |
| bool m_isNewlyCreatedKey = false; |
| }; |
| |
| } // namespace ndncert |
| } // namespace ndn |
| |
| #endif // NDNCERT_REQUESTER_STATE_HPP |