ladybird/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h

31 lines
735 B
C
Raw Normal View History

/*
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Forward.h>
2022-09-03 19:59:53 +02:00
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::Crypto {
2022-09-03 19:59:53 +02:00
class SubtleCrypto final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(SubtleCrypto, Bindings::PlatformObject);
JS_DECLARE_ALLOCATOR(SubtleCrypto);
2022-09-03 19:59:53 +02:00
public:
[[nodiscard]] static JS::NonnullGCPtr<SubtleCrypto> create(JS::Realm&);
2022-09-03 19:59:53 +02:00
virtual ~SubtleCrypto() override;
JS::NonnullGCPtr<JS::Promise> digest(String const& algorithm, JS::Handle<WebIDL::BufferSource> const& data);
private:
explicit SubtleCrypto(JS::Realm&);
virtual void initialize(JS::Realm&) override;
};
}