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_JWK_UTILS_H_ 6 #define NET_DEVICE_BOUND_SESSIONS_JWK_UTILS_H_ 7 8 #include "base/containers/span.h" 9 #include "base/values.h" 10 #include "crypto/signature_verifier.h" 11 #include "net/base/net_export.h" 12 13 namespace net::device_bound_sessions { 14 // Converts a public key in SPKI format to a JWK (JSON Web Key). Only supports 15 // ES256 and RS256 keys. 16 base::Value::Dict NET_EXPORT 17 ConvertPkeySpkiToJwk(crypto::SignatureVerifier::SignatureAlgorithm algorithm, 18 base::span<const uint8_t> pkey_spki); 19 } // namespace net::device_bound_sessions 20 21 #endif // NET_DEVICE_BOUND_SESSIONS_JWK_UTILS_H_ 22