OLD | NEW |
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 Loading... |
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 GenerateKey(const blink::WebCryptoAlgorithm& algorithm, | 31 Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm, |
32 bool extractable, | 32 bool extractable, |
33 blink::WebCryptoKeyUsageMask usage_mask, | 33 blink::WebCryptoKeyUsageMask usage_mask, |
34 GenerateKeyResult* result) const override; | 34 GenerateKeyResult* result) const override; |
35 | 35 |
36 virtual Status VerifyKeyUsagesBeforeImportKey( | 36 Status VerifyKeyUsagesBeforeImportKey( |
37 blink::WebCryptoKeyFormat format, | 37 blink::WebCryptoKeyFormat format, |
38 blink::WebCryptoKeyUsageMask usage_mask) const override; | 38 blink::WebCryptoKeyUsageMask usage_mask) const override; |
39 | 39 |
40 virtual Status ImportKeyRaw(const CryptoData& key_data, | 40 Status ImportKeyRaw(const CryptoData& key_data, |
41 const blink::WebCryptoAlgorithm& algorithm, | 41 const blink::WebCryptoAlgorithm& algorithm, |
42 bool extractable, | 42 bool extractable, |
43 blink::WebCryptoKeyUsageMask usage_mask, | 43 blink::WebCryptoKeyUsageMask usage_mask, |
44 blink::WebCryptoKey* key) const override; | 44 blink::WebCryptoKey* key) const override; |
45 | 45 |
46 virtual Status ImportKeyJwk(const CryptoData& key_data, | 46 Status ImportKeyJwk(const CryptoData& key_data, |
47 const blink::WebCryptoAlgorithm& algorithm, | 47 const blink::WebCryptoAlgorithm& algorithm, |
48 bool extractable, | 48 bool extractable, |
49 blink::WebCryptoKeyUsageMask usage_mask, | 49 blink::WebCryptoKeyUsageMask usage_mask, |
50 blink::WebCryptoKey* key) const override; | 50 blink::WebCryptoKey* key) const override; |
51 | 51 |
52 virtual Status ExportKeyRaw(const blink::WebCryptoKey& key, | 52 Status ExportKeyRaw(const blink::WebCryptoKey& key, |
53 std::vector<uint8_t>* buffer) const override; | 53 std::vector<uint8_t>* buffer) const override; |
54 | 54 |
55 virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, | 55 Status ExportKeyJwk(const blink::WebCryptoKey& key, |
56 std::vector<uint8_t>* buffer) const override; | 56 std::vector<uint8_t>* buffer) const override; |
57 | 57 |
58 private: | 58 private: |
59 const blink::WebCryptoKeyUsageMask all_key_usages_; | 59 const blink::WebCryptoKeyUsageMask all_key_usages_; |
60 const std::string jwk_suffix_; | 60 const std::string jwk_suffix_; |
61 }; | 61 }; |
62 | 62 |
63 } // namespace webcrypto | 63 } // namespace webcrypto |
64 | 64 |
65 } // namespace content | 65 } // namespace content |
66 | 66 |
67 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ | 67 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ |
OLD | NEW |