#include "components/media_router/common/providers/cast/certificate/net_parsed_certificate.h"
#include "base/containers/contains.h"
#include "net/cert/time_conversions.h"
#include "net/cert/x509_util.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/pki/input.h"
#include "third_party/boringssl/src/pki/parse_name.h"
#include "third_party/boringssl/src/pki/parse_values.h"
namespace openscreen::cast {
ErrorOr<std::unique_ptr<ParsedCertificate>> ParsedCertificate::ParseFromDER(
const std::vector<uint8_t>& der_cert) { … }
}
namespace cast_certificate {
ErrorOr;
DateTime;
DigestAlgorithm;
namespace {
bool GetCommonNameFromSubject(const bssl::der::Input& subject_tlv,
std::string* common_name) { … }
}
bssl::ParseCertificateOptions GetCertParsingOptions() { … }
NetParsedCertificate::NetParsedCertificate(
std::shared_ptr<const bssl::ParsedCertificate> cert)
: … { … }
NetParsedCertificate::~NetParsedCertificate() = default;
ErrorOr<std::vector<uint8_t>> NetParsedCertificate::SerializeToDER(
int front_spacing) const { … }
ErrorOr<DateTime> NetParsedCertificate::GetNotBeforeTime() const { … }
ErrorOr<DateTime> NetParsedCertificate::GetNotAfterTime() const { … }
std::string NetParsedCertificate::GetCommonName() const { … }
std::string NetParsedCertificate::GetSpkiTlv() const { … }
ErrorOr<uint64_t> NetParsedCertificate::GetSerialNumber() const { … }
bool NetParsedCertificate::VerifySignedData(
DigestAlgorithm algorithm,
const openscreen::ByteView& data,
const openscreen::ByteView& signature) const { … }
bool NetParsedCertificate::HasPolicyOid(const openscreen::ByteView& oid) const { … }
void NetParsedCertificate::SetNotBeforeTimeForTesting(time_t not_before) { … }
void NetParsedCertificate::SetNotAfterTimeForTesting(time_t not_after) { … }
}