#ifndef CAST_SENDER_CHANNEL_CAST_AUTH_UTIL_H_
#define CAST_SENDER_CHANNEL_CAST_AUTH_UTIL_H_
#include <chrono>
#include <string>
#include <vector>
#include "cast/common/certificate/cast_cert_validator.h"
#include "platform/base/error.h"
namespace openscreen::cast {
namespace proto {
class AuthResponse;
class CastMessage;
}
enum class CRLPolicy;
struct DateTime;
class TrustStore;
class ParsedCertificate;
class AuthContext { … };
ErrorOr<CastDeviceCertPolicy> AuthenticateChallengeReply(
const proto::CastMessage& challenge_reply,
const ParsedCertificate& peer_cert,
const AuthContext& auth_context,
TrustStore* cast_trust_store,
TrustStore* crl_trust_store);
ErrorOr<CastDeviceCertPolicy> AuthenticateChallengeReplyForTest(
const proto::CastMessage& challenge_reply,
const ParsedCertificate& peer_cert,
const AuthContext& auth_context,
CRLPolicy crl_policy,
TrustStore* cast_trust_store,
TrustStore* crl_trust_store,
const DateTime& verification_time);
Error VerifyTLSCertificateValidity(const ParsedCertificate& peer_cert,
std::chrono::seconds verification_time);
ErrorOr<CastDeviceCertPolicy> VerifyCredentials(
const proto::AuthResponse& response,
const std::vector<uint8_t>& signature_input,
TrustStore* cast_trust_store,
TrustStore* crl_trust_store,
bool enforce_revocation_checking = false,
bool enforce_sha256_checking = false);
ErrorOr<CastDeviceCertPolicy> VerifyCredentialsForTest(
const proto::AuthResponse& response,
const std::vector<uint8_t>& signature_input,
CRLPolicy crl_policy,
TrustStore* cast_trust_store,
TrustStore* crl_trust_store,
const DateTime& verification_time,
bool enforce_sha256_checking = false);
}
#endif