#include "services/network/trust_tokens/boringssl_trust_token_test_utils.h"
#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/base64.h"
#include "base/containers/span.h"
#include "base/ranges/algorithm.h"
#include "services/network/trust_tokens/scoped_boringssl_bytes.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/trust_token.h"
namespace network {
TestTrustTokenIssuer::VerificationKey::VerificationKey(
uint32_t id,
std::vector<uint8_t> value)
: … { … }
TestTrustTokenIssuer::VerificationKey::~VerificationKey() = default;
TestTrustTokenIssuer::VerificationKey::VerificationKey(const VerificationKey&) =
default;
TestTrustTokenIssuer::TokenKeyPair::TokenKeyPair() = default;
TestTrustTokenIssuer::TokenKeyPair::~TokenKeyPair() = default;
TestTrustTokenIssuer::TokenKeyPair::TokenKeyPair(const TokenKeyPair&) = default;
TestTrustTokenIssuer::TokenKeyPair::TokenKeyPair(
std::vector<uint8_t> signing,
std::vector<uint8_t> verification,
uint32_t key_id)
: … { … }
TestTrustTokenIssuer::TokenKeyPair TestTrustTokenIssuer::GenerateTokenKeyPair(
uint32_t key_id) { … }
TestTrustTokenIssuer::~TestTrustTokenIssuer() = default;
TestTrustTokenIssuer::TestTrustTokenIssuer(uint8_t num_keys,
uint8_t max_issuance)
: … { … }
std::optional<std::string> TestTrustTokenIssuer::Issue(
const std::string& issuance_request) const { … }
std::optional<std::string> TestTrustTokenIssuer::IssueUsingKey(
const std::string& issuance_request,
const uint32_t& key_id) const { … }
bssl::UniquePtr<TRUST_TOKEN> TestTrustTokenIssuer::Redeem(
const std::string& redemption_request) const { … }
bssl::UniquePtr<TRUST_TOKEN> TestTrustTokenIssuer::RedeemOverMessage(
const std::string& redemption_request,
const std::string& message) const { … }
}