#include "components/webcrypto/blink_key_handle.h"
#include <utility>
#include "base/check_op.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
namespace webcrypto {
namespace {
class SymKey;
class AsymKey;
class Key : public blink::WebCryptoKeyHandle { … };
class SymKey : public Key { … };
class AsymKey : public Key { … };
Key* GetKey(const blink::WebCryptoKey& key) { … }
}
const std::vector<uint8_t>& GetSymmetricKeyData(
const blink::WebCryptoKey& key) { … }
EVP_PKEY* GetEVP_PKEY(const blink::WebCryptoKey& key) { … }
blink::WebCryptoKeyHandle* CreateSymmetricKeyHandle(
base::span<const uint8_t> key_bytes) { … }
blink::WebCryptoKeyHandle* CreateAsymmetricKeyHandle(
bssl::UniquePtr<EVP_PKEY> pkey) { … }
}