diff options
author | Liam <byteslice@airmail.cc> | 2024-02-24 18:49:08 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-25 04:56:05 +0100 |
commit | fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13 (patch) | |
tree | eba5380db4c87d13c25b61c8262cb9d01ba70637 /src/core/hle/service/ssl/cert_store.h | |
parent | acc: add account manager for acc:u1 (diff) | |
download | yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar.gz yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar.bz2 yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar.lz yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar.xz yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.tar.zst yuzu-fd718f350ca4f13e4c2c0ca5ea4a9931255d3c13.zip |
Diffstat (limited to 'src/core/hle/service/ssl/cert_store.h')
-rw-r--r-- | src/core/hle/service/ssl/cert_store.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/core/hle/service/ssl/cert_store.h b/src/core/hle/service/ssl/cert_store.h new file mode 100644 index 000000000..613d7b02a --- /dev/null +++ b/src/core/hle/service/ssl/cert_store.h @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <map> +#include <span> +#include <vector> + +#include "core/hle/result.h" +#include "core/hle/service/ssl/ssl_types.h" + +namespace Core { +class System; +} + +namespace Service::SSL { + +class CertStore { +public: + explicit CertStore(Core::System& system); + ~CertStore(); + + Result GetCertificates(u32* out_num_entries, std::span<u8> out_data, + std::span<const CaCertificateId> certificate_ids); + Result GetCertificateBufSize(u32* out_size, u32* out_num_entries, + std::span<const CaCertificateId> certificate_ids); + +private: + template <typename F> + void ForEachCertificate(std::span<const CaCertificateId> certs, F&& f); + +private: + struct Certificate { + TrustedCertStatus status; + std::vector<u8> der_data; + }; + + std::map<CaCertificateId, Certificate> m_certs; +}; + +} // namespace Service::SSL |