1 // Copyright 2024 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_DEVICE_BOUND_SESSIONS_TEST_SUPPORT_H_ 6 #define NET_DEVICE_BOUND_SESSIONS_TEST_SUPPORT_H_ 7 8 #include <string> 9 #include <utility> 10 11 #include "base/containers/span.h" 12 #include "net/test/embedded_test_server/embedded_test_server.h" 13 #include "url/gurl.h" 14 15 namespace net::device_bound_sessions { 16 17 // Return a hard-coded RS256 public key's SPKI bytes and JWK string for testing. 18 std::pair<base::span<const uint8_t>, std::string> 19 GetRS256SpkiAndJwkForTesting(); 20 21 // Returns a request handler suitable for use with 22 // `EmbeddedTestServer`. The server allows registration of device bound 23 // sessions. 24 EmbeddedTestServer::HandleRequestCallback GetTestRequestHandler( 25 const GURL& base_url); 26 27 } // namespace net::device_bound_sessions 28 29 #endif // NET_DEVICE_BOUND_SESSIONS_TEST_SUPPORT_H_ 30