| 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 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 blink::WebCryptoKey*, |
| 35 bool extractable, | 35 blink::WebCryptoKey* key) const OVERRIDE; |
| 36 blink::WebCryptoKeyUsageMask usage_mask, | |
| 37 blink::WebCryptoKey* key) const OVERRIDE; | |
| 38 | 36 |
| 39 virtual Status VerifyKeyUsagesBeforeImportKey( | 37 virtual Status VerifyKeyUsagesBeforeImportKey( |
| 40 blink::WebCryptoKeyFormat format, | 38 blink::WebCryptoKeyFormat format, |
| 41 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE; | 39 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE; |
| 42 | 40 |
| 43 virtual Status ImportKeyRaw(const CryptoData& key_data, | 41 virtual Status ImportKeyRaw(const CryptoData& key_data, |
| 44 const blink::WebCryptoAlgorithm& algorithm, | 42 const blink::WebCryptoAlgorithm& algorithm, |
| 45 bool extractable, | 43 bool extractable, |
| 46 blink::WebCryptoKeyUsageMask usage_mask, | 44 blink::WebCryptoKeyUsageMask usage_mask, |
| 47 blink::WebCryptoKey* key) const OVERRIDE; | 45 blink::WebCryptoKey* key) const OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 61 private: | 59 private: |
| 62 const blink::WebCryptoKeyUsageMask all_key_usages_; | 60 const blink::WebCryptoKeyUsageMask all_key_usages_; |
| 63 const std::string jwk_suffix_; | 61 const std::string jwk_suffix_; |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 } // namespace webcrypto | 64 } // namespace webcrypto |
| 67 | 65 |
| 68 } // namespace content | 66 } // namespace content |
| 69 | 67 |
| 70 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ | 68 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_AES_OPENSSL_H_ |
| OLD | NEW |