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

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

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run git-cl format Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_
6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_
7 7
8 #include "content/child/webcrypto/algorithm_implementation.h" 8 #include "content/child/webcrypto/algorithm_implementation.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 10 matching lines...) Expand all
21 // is the JWK name for 128-bit AES-CBC. The |jwk_suffix| in this case would 21 // is the JWK name for 128-bit AES-CBC. The |jwk_suffix| in this case would
22 // be "CBC". 22 // be "CBC".
23 AesAlgorithm(blink::WebCryptoKeyUsageMask all_key_usages, 23 AesAlgorithm(blink::WebCryptoKeyUsageMask all_key_usages,
24 const std::string& jwk_suffix); 24 const std::string& jwk_suffix);
25 25
26 // This is the same as the other AesAlgorithm constructor where 26 // This is the same as the other AesAlgorithm constructor where
27 // |all_key_usages| is pre-filled to values for encryption/decryption 27 // |all_key_usages| is pre-filled to values for encryption/decryption
28 // algorithms (supports usages for: encrypt, decrypt, wrap, unwrap). 28 // algorithms (supports usages for: encrypt, decrypt, wrap, unwrap).
29 explicit AesAlgorithm(const std::string& jwk_suffix); 29 explicit AesAlgorithm(const std::string& jwk_suffix);
30 30
31 virtual Status VerifyKeyUsagesBeforeGenerateKey( 31 virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
32 blink::WebCryptoKeyUsageMask usage_mask) const override; 32 bool extractable,
33 33 blink::WebCryptoKeyUsageMask usage_mask,
34 virtual Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, 34 GenerateKeyResult* result) const override;
35 bool extractable,
36 blink::WebCryptoKeyUsageMask usage_mask,
37 blink::WebCryptoKey* key) const override;
38 35
39 virtual Status VerifyKeyUsagesBeforeImportKey( 36 virtual Status VerifyKeyUsagesBeforeImportKey(
40 blink::WebCryptoKeyFormat format, 37 blink::WebCryptoKeyFormat format,
41 blink::WebCryptoKeyUsageMask usage_mask) const override; 38 blink::WebCryptoKeyUsageMask usage_mask) const override;
42 39
43 virtual Status ImportKeyRaw(const CryptoData& key_data, 40 virtual Status ImportKeyRaw(const CryptoData& key_data,
44 const blink::WebCryptoAlgorithm& algorithm, 41 const blink::WebCryptoAlgorithm& algorithm,
45 bool extractable, 42 bool extractable,
46 blink::WebCryptoKeyUsageMask usage_mask, 43 blink::WebCryptoKeyUsageMask usage_mask,
47 blink::WebCryptoKey* key) const override; 44 blink::WebCryptoKey* key) const override;
(...skipping 13 matching lines...) Expand all
61 private: 58 private:
62 const blink::WebCryptoKeyUsageMask all_key_usages_; 59 const blink::WebCryptoKeyUsageMask all_key_usages_;
63 const std::string jwk_suffix_; 60 const std::string jwk_suffix_;
64 }; 61 };
65 62
66 } // namespace webcrypto 63 } // namespace webcrypto
67 64
68 } // namespace content 65 } // namespace content
69 66
70 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ 67 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/nss/sym_key_nss.cc ('k') | content/child/webcrypto/openssl/aes_key_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698