Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1535)

Unified Diff: Source/modules/crypto/Key.h

Issue 18033004: WebCrypto: Add WebKit API structure for keys. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/crypto/CryptoOperation.cpp ('k') | Source/modules/crypto/Key.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/Key.h
diff --git a/Source/modules/crypto/WorkerCrypto.h b/Source/modules/crypto/Key.h
similarity index 76%
copy from Source/modules/crypto/WorkerCrypto.h
copy to Source/modules/crypto/Key.h
index 5bbb3f5d39eba918f40aab6f91439d3993547e81..a022802ae28068d20ecec5c3570481542050f72b 100644
--- a/Source/modules/crypto/WorkerCrypto.h
+++ b/Source/modules/crypto/Key.h
@@ -28,26 +28,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WorkerCrypto_h
-#define WorkerCrypto_h
+#ifndef Key_h
+#define Key_h
#include "bindings/v8/ScriptWrappable.h"
+#include "public/platform/WebCryptoKey.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
-typedef int ExceptionCode;
+class Algorithm;
-class WorkerCrypto : public ScriptWrappable, public RefCounted<WorkerCrypto> {
+class Key : public ScriptWrappable, public RefCounted<Key> {
public:
- static PassRefPtr<WorkerCrypto> create() { return adoptRef(new WorkerCrypto()); }
+ static PassRefPtr<Key> create(const WebKit::WebCryptoKey& key) { return adoptRef(new Key(key)); }
-private:
- WorkerCrypto();
+ String type() const;
+ bool extractable() const;
+ Algorithm* algorithm();
+ Vector<String> keyUsage() const;
+
+protected:
+ explicit Key(const WebKit::WebCryptoKey&);
+
+ const WebKit::WebCryptoKey m_key;
+ RefPtr<Algorithm> m_algorithm;
};
-}
+} // namespace WebCore
#endif
« no previous file with comments | « Source/modules/crypto/CryptoOperation.cpp ('k') | Source/modules/crypto/Key.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698