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