#include "cast/common/certificate/boringssl_parsed_certificate.h"
#include <openssl/x509v3.h>
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "cast/common/certificate/boringssl_util.h"
#include "util/crypto/certificate_utils.h"
#include "util/osp_logging.h"
namespace openscreen::cast {
namespace {
const EVP_MD* MapDigestAlgorithm(DigestAlgorithm algorithm) { … }
}
ErrorOr<std::unique_ptr<ParsedCertificate>> ParsedCertificate::ParseFromDER(
const std::vector<uint8_t>& der_cert) { … }
BoringSSLParsedCertificate::BoringSSLParsedCertificate() = default;
BoringSSLParsedCertificate::BoringSSLParsedCertificate(
bssl::UniquePtr<X509> cert)
: … { … }
BoringSSLParsedCertificate::~BoringSSLParsedCertificate() = default;
ErrorOr<std::vector<uint8_t>> BoringSSLParsedCertificate::SerializeToDER(
int front_spacing) const { … }
ErrorOr<DateTime> BoringSSLParsedCertificate::GetNotBeforeTime() const { … }
ErrorOr<DateTime> BoringSSLParsedCertificate::GetNotAfterTime() const { … }
std::string BoringSSLParsedCertificate::GetCommonName() const { … }
std::string BoringSSLParsedCertificate::GetSpkiTlv() const { … }
ErrorOr<uint64_t> BoringSSLParsedCertificate::GetSerialNumber() const { … }
bool BoringSSLParsedCertificate::VerifySignedData(
DigestAlgorithm algorithm,
const ByteView& data,
const ByteView& signature) const { … }
bool BoringSSLParsedCertificate::HasPolicyOid(const ByteView& oid) const { … }
void BoringSSLParsedCertificate::SetNotBeforeTimeForTesting(time_t not_before) { … }
void BoringSSLParsedCertificate::SetNotAfterTimeForTesting(time_t not_after) { … }
}