CryptoAlgorithmAES_CBC.h [plain text]
#ifndef CryptoAlgorithmAES_CBC_h
#define CryptoAlgorithmAES_CBC_h
#include "CryptoAlgorithm.h"
#if ENABLE(SUBTLE_CRYPTO)
namespace WebCore {
class CryptoAlgorithmAesCbcParams;
class CryptoKeyAES;
class CryptoAlgorithmAES_CBC final : public CryptoAlgorithm {
public:
static const char* const s_name;
static const CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::AES_CBC;
static Ref<CryptoAlgorithm> create();
CryptoAlgorithmIdentifier identifier() const override;
void encrypt(const CryptoAlgorithmParameters&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback, ExceptionCode&) override;
void decrypt(const CryptoAlgorithmParameters&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback, ExceptionCode&) override;
void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, VoidCallback&& failureCallback, ExceptionCode&) override;
void importKey(const CryptoAlgorithmParameters&, const CryptoKeyData&, bool extractable, CryptoKeyUsage, KeyCallback&&, VoidCallback&& failureCallback, ExceptionCode&) override;
private:
CryptoAlgorithmAES_CBC();
virtual ~CryptoAlgorithmAES_CBC();
bool keyAlgorithmMatches(const CryptoAlgorithmAesCbcParams& algorithmParameters, const CryptoKey&) const;
void platformEncrypt(const CryptoAlgorithmAesCbcParams&, const CryptoKeyAES&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback, ExceptionCode&);
void platformDecrypt(const CryptoAlgorithmAesCbcParams&, const CryptoKeyAES&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback, ExceptionCode&);
};
}
#endif // ENABLE(SUBTLE_CRYPTO)
#endif // CryptoAlgorithmAES_CBC_h