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

Side by Side Diff: content/child/webcrypto/openssl/key_openssl.h

Issue 379383002: Refactor WebCrypto code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto master (no longer has BoringSSL) Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
7
8 #include "content/child/webcrypto/algorithm_implementation.h"
9
10 namespace content {
11
12 namespace webcrypto {
13
14 class SymKeyOpenSsl;
15
16 // Base key class for all OpenSSL keys, used to safely cast between types. Each
17 // key maintains a copy of its serialized form in either 'raw', 'pkcs8', or
18 // 'spki' format. This is to allow structured cloning of keys synchronously from
19 // the target Blink thread without having to lock access to the key.
20 class KeyOpenSsl : public blink::WebCryptoKeyHandle {
21 public:
22 explicit KeyOpenSsl(const CryptoData& serialized_key_data);
23 virtual ~KeyOpenSsl();
24
25 virtual SymKeyOpenSsl* AsSymKey();
26
27 const std::vector<uint8>& serialized_key_data() const {
28 return serialized_key_data_;
29 }
30
31 private:
32 const std::vector<uint8> serialized_key_data_;
33 };
34
35 class SymKeyOpenSsl : public KeyOpenSsl {
36 public:
37 virtual ~SymKeyOpenSsl();
38 explicit SymKeyOpenSsl(const CryptoData& raw_key_data);
39
40 static SymKeyOpenSsl* Cast(const blink::WebCryptoKey& key);
41
42 virtual SymKeyOpenSsl* AsSymKey() OVERRIDE;
43
44 const std::vector<uint8>& raw_key_data() const {
45 return serialized_key_data();
46 }
47
48 private:
49 DISALLOW_COPY_AND_ASSIGN(SymKeyOpenSsl);
50 };
51
52 } // namespace webcrypto
53
54 } // namespace content
55
56 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/hmac_openssl.cc ('k') | content/child/webcrypto/openssl/key_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698