#include "anonymous_tokens/cpp/privacy_pass/token_encodings.h"
#include <sys/types.h>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/ascii.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
#include "absl/time/time.h"
#include "absl/types/span.h"
#include "anonymous_tokens/cpp/shared/status_utils.h"
#include <openssl/base.h>
#include <openssl/bytestring.h>
#include <openssl/mem.h>
namespace anonymous_tokens {
namespace {
absl::StatusOr<std::string> EncodeTokenStructHelper(
const uint16_t& token_type, const std::string& token_key_id,
const std::string& nonce, const std::string& context,
const std::optional<std::string> authenticator) { … }
absl::StatusOr<Extension> decodeExtension(CBS* extensions_cbs) { … }
}
absl::StatusOr<std::string> AuthenticatorInput(const Token& token) { … }
absl::StatusOr<std::string> MarshalToken(const Token& token) { … }
absl::StatusOr<Token> UnmarshalToken(std::string token) { … }
absl::StatusOr<std::string> EncodeExtension(const Extension& extension) { … }
absl::StatusOr<std::string> EncodeExtensions(const Extensions& extensions) { … }
absl::StatusOr<ExpirationTimestamp> ExpirationTimestamp::FromExtension(
const Extension& ext) { … }
absl::StatusOr<Extension> ExpirationTimestamp::AsExtension() const { … }
absl::StatusOr<Extension> GeoHint::AsExtension() const { … }
absl::StatusOr<GeoHint> GeoHint::FromExtension(const Extension& ext) { … }
absl::StatusOr<Extension> ServiceType::AsExtension() const { … }
absl::StatusOr<ServiceType> ServiceType::FromExtension(const Extension& ext) { … }
absl::StatusOr<Extension> DebugMode::AsExtension() const { … }
absl::StatusOr<DebugMode> DebugMode::FromExtension(const Extension& ext) { … }
absl::StatusOr<Extension> ProxyLayer::AsExtension() const { … }
absl::StatusOr<ProxyLayer> ProxyLayer::FromExtension(const Extension& ext) { … }
absl::StatusOr<Extensions> DecodeExtensions(
absl::string_view encoded_extensions) { … }
absl::StatusOr<std::string> MarshalTokenChallenge(
const TokenChallenge& token_challenge) { … }
absl::StatusOr<std::string> MarshalTokenRequest(
const TokenRequest& token_request) { … }
absl::StatusOr<TokenRequest> UnmarshalTokenRequest(
absl::string_view token_request) { … }
absl::StatusOr<std::string> MarshalExtendedTokenRequest(
const ExtendedTokenRequest& extended_token_request) { … }
absl::StatusOr<ExtendedTokenRequest> UnmarshalExtendedTokenRequest(
absl::string_view extended_token_request) { … }
absl::Status ValidateExtensionsOrderAndValues(
const Extensions& extensions, absl::Span<uint16_t> expected_types,
absl::Time now) { … }
absl::Status ValidateExtensionsValues(const Extensions& extensions,
absl::Time now) { … }
}