// Copyright 2024 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine Master // License Agreement. #ifndef FILE_UTIL_H_ #define FILE_UTIL_H_ #include #include "cas_status.h" #include "crypto_wrapped_key.h" #include "device_files.pb.h" #include "file_store.h" namespace wvcas { bool ReadFileFromStorage(wvutil::FileSystem& file_system, const std::string& filename, std::string* file_data); bool RemoveFile(wvutil::FileSystem& file_system, const std::string& filename); bool StoreFile(wvutil::FileSystem& file_system, const std::string& filename, const std::string& file_data); bool StoreFileWithHash(wvutil::FileSystem& file_system, const std::string& name, const std::string& serialized_file); bool StoreOemCertificate(wvutil::FileSystem& file_system, const std::string& certificate, const CryptoWrappedKey& private_key); bool StoreCertificate(wvutil::FileSystem& file_system, const std::string& certificate, const CryptoWrappedKey& private_key); CasStatus RetrieveHashedFile(const std::string& certificate, video_widevine_client::sdk::File& file); bool RetrieveOemCertificate(wvutil::FileSystem& file_system, std::string& certificate, CryptoWrappedKey* wrapped_private_key); } // namespace wvcas #endif // FILE_UTIL_H_