// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVICE_FIDO_P256_PUBLIC_KEY_H_ #define DEVICE_FIDO_P256_PUBLIC_KEY_H_ #include #include #include "base/component_export.h" #include "base/containers/span.h" #include "components/cbor/values.h" namespace device { struct PublicKey; struct COMPONENT_EXPORT(DEVICE_FIDO) P256PublicKey { static std::unique_ptr ExtractFromU2fRegistrationResponse( int32_t algorithm, base::span u2f_data); static std::unique_ptr ExtractFromCOSEKey( int32_t algorithm, base::span cbor_bytes, const cbor::Value::MapValue& map); // Parse a public key encoded in ANSI X9.62 uncompressed format. static std::unique_ptr ParseX962Uncompressed( int32_t algorithm, base::span input); }; } // namespace device #endif // DEVICE_FIDO_P256_PUBLIC_KEY_H_