signed_web_bundle_utils.h 987 B

12345678910111213141516171819202122232425
  1. // Copyright 2022 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_WEB_PACKAGE_SIGNED_WEB_BUNDLES_SIGNED_WEB_BUNDLE_UTILS_H_
  5. #define COMPONENTS_WEB_PACKAGE_SIGNED_WEB_BUNDLES_SIGNED_WEB_BUNDLE_UTILS_H_
  6. #include <vector>
  7. #include "base/containers/span.h"
  8. namespace web_package {
  9. // Helper function to construct and correctly encode the payload from the
  10. // unsigned web bundle's hash, the integrity block, and the attributes of the
  11. // signature stack entry. The payload can then be used to verify or calculate
  12. // the signed web bundle's signature.
  13. std::vector<uint8_t> CreateSignaturePayload(
  14. base::span<const uint8_t> unsigned_bundle_hash,
  15. base::span<const uint8_t> integrity_block,
  16. base::span<const uint8_t> signature_stack_entry_attributes);
  17. } // namespace web_package
  18. #endif // COMPONENTS_WEB_PACKAGE_SIGNED_WEB_BUNDLES_SIGNED_WEB_BUNDLE_UTILS_H_