cast_cert_reader.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_CAST_CERTIFICATE_CAST_CERT_READER_H_
  5. #define COMPONENTS_CAST_CERTIFICATE_CAST_CERT_READER_H_
  6. #include <memory>
  7. #include <string>
  8. #include <vector>
  9. #include "base/files/file_path.h"
  10. #include "net/cert/pki/trust_store_in_memory.h"
  11. namespace cast_certificate {
  12. // Creates a trust store using the test roots encoded in the PEM file at |path|.
  13. bool PopulateStoreWithCertsFromPath(net::TrustStoreInMemory* store,
  14. const base::FilePath& path);
  15. // Reads a PEM file located at |path|, containing certificates to a vector of
  16. // their DER data.
  17. std::vector<std::string> ReadCertificateChainFromFile(
  18. const base::FilePath& path);
  19. // Reads a PEM certificate list loaded into a C-string |str| into a
  20. // vector of their DER data.
  21. std::vector<std::string> ReadCertificateChainFromString(const char* str);
  22. } // namespace cast_certificate
  23. #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CERT_READER_H_