CryptoAlgorithmECDH.h [plain text]
#pragma once
#include "CryptoAlgorithm.h"
#if ENABLE(SUBTLE_CRYPTO)
namespace WebCore {
class CryptoAlgorithmECDH final : public CryptoAlgorithm {
public:
static constexpr const char* s_name = "ECDH";
static constexpr CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::ECDH;
static Ref<CryptoAlgorithm> create();
private:
CryptoAlgorithmECDH() = default;
CryptoAlgorithmIdentifier identifier() const final;
void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
void deriveBits(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, size_t length, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
using Callback = Function<void(std::optional<Vector<uint8_t>>&&, size_t)>;
void platformDeriveBits(Ref<CryptoKey>&& baseKey, Ref<CryptoKey>&& publicKey, size_t length, Callback&&, ScriptExecutionContext&, WorkQueue&);
};
}
#endif // ENABLE(SUBTLE_CRYPTO)