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

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

Issue 379383002: Refactor WebCrypto code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master 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_AES_OPENSSL_H_
6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_
7
8 #include "content/child/webcrypto/algorithm_implementation.h"
9
10 namespace content {
11
12 namespace webcrypto {
13
14 // Base class for AES algorithms that provides the implementation for key
15 // creation and export.
16 class AesAlgorithm : public AlgorithmImplementation {
17 public:
18 AesAlgorithm(blink::WebCryptoKeyUsageMask all_key_usages,
19 const std::string& jwk_suffix);
20
21 // Shortcut for creating an encryption algorithm, with support for encrypt,
22 // decrypt, wrap, unwrap.
23 explicit AesAlgorithm(const std::string& jwk_suffix);
Ryan Sleevi 2014/07/17 00:06:54 Document (in particular, jwk_suffix)
eroman 2014/07/17 20:37:26 Done. Documented as: // This is the same as the
24
25 virtual Status VerifyKeyUsagesBeforeGenerateKey(
26 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE;
27
28 virtual Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
29 bool extractable,
30 blink::WebCryptoKeyUsageMask usage_mask,
31 blink::WebCryptoKey* key) const OVERRIDE;
32
33 virtual Status VerifyKeyUsagesBeforeImportKey(
34 blink::WebCryptoKeyFormat format,
35 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE;
36
37 virtual Status ImportKeyRaw(const CryptoData& key_data,
38 const blink::WebCryptoAlgorithm& algorithm,
39 bool extractable,
40 blink::WebCryptoKeyUsageMask usage_mask,
41 blink::WebCryptoKey* key) const OVERRIDE;
42
43 virtual Status ImportKeyJwk(const CryptoData& key_data,
44 const blink::WebCryptoAlgorithm& algorithm,
45 bool extractable,
46 blink::WebCryptoKeyUsageMask usage_mask,
47 blink::WebCryptoKey* key) const OVERRIDE;
48
49 virtual Status ExportKeyRaw(const blink::WebCryptoKey& key,
50 std::vector<uint8>* buffer) const OVERRIDE;
51
52 virtual Status ExportKeyJwk(const blink::WebCryptoKey& key,
53 std::vector<uint8>* buffer) const OVERRIDE;
54
55 private:
56 const blink::WebCryptoKeyUsageMask all_key_usages_;
57 const std::string jwk_suffix_;
58 };
59
60 } // namespace webcrypto
61
62 } // namespace content
63
64 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698