CryptoAlgorithmAES_GCM.h [plain text]
#pragma once
#include "CryptoAlgorithm.h"
#if ENABLE(WEB_CRYPTO)
namespace WebCore {
class CryptoAlgorithmAesGcmParams;
class CryptoKeyAES;
class CryptoAlgorithmAES_GCM final : public CryptoAlgorithm {
public:
static constexpr const char* s_name = "AES-GCM";
static constexpr CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::AES_GCM;
static Ref<CryptoAlgorithm> create();
private:
CryptoAlgorithmAES_GCM() = default;
CryptoAlgorithmIdentifier identifier() const final;
void encrypt(const CryptoAlgorithmParameters&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
void decrypt(const CryptoAlgorithmParameters&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
void importKey(CryptoKeyFormat, KeyData&&, const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
void exportKey(CryptoKeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
ExceptionOr<size_t> getKeyLength(const CryptoAlgorithmParameters&) final;
static ExceptionOr<Vector<uint8_t>> platformEncrypt(const CryptoAlgorithmAesGcmParams&, const CryptoKeyAES&, const Vector<uint8_t>&);
static ExceptionOr<Vector<uint8_t>> platformDecrypt(const CryptoAlgorithmAesGcmParams&, const CryptoKeyAES&, const Vector<uint8_t>&);
};
}
#endif // ENABLE(WEB_CRYPTO)