OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 5 #ifndef MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 int init_data_length, | 45 int init_data_length, |
46 const std::string& session_id) OVERRIDE; | 46 const std::string& session_id) OVERRIDE; |
47 virtual void CancelKeyRequest(const std::string& key_system, | 47 virtual void CancelKeyRequest(const std::string& key_system, |
48 const std::string& session_id) OVERRIDE; | 48 const std::string& session_id) OVERRIDE; |
49 // Decrypts |encrypted| buffer. |encrypted| should not be NULL. |encrypted| | 49 // Decrypts |encrypted| buffer. |encrypted| should not be NULL. |encrypted| |
50 // will signal if an integrity check must be performed before decryption. | 50 // will signal if an integrity check must be performed before decryption. |
51 // Returns a DecoderBuffer with the decrypted data if the decryption | 51 // Returns a DecoderBuffer with the decrypted data if the decryption |
52 // succeeded through |decrypt_cb|. | 52 // succeeded through |decrypt_cb|. |
53 virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted, | 53 virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted, |
54 const DecryptCB& decrypt_cb) OVERRIDE; | 54 const DecryptCB& decrypt_cb) OVERRIDE; |
| 55 virtual void Stop() OVERRIDE; |
55 | 56 |
56 private: | 57 private: |
57 // Helper class that manages the decryption key and HMAC key. The HMAC key | 58 // Helper class that manages the decryption key and HMAC key. The HMAC key |
58 // may be NULL. | 59 // may be NULL. |
59 class DecryptionKey { | 60 class DecryptionKey { |
60 public: | 61 public: |
61 explicit DecryptionKey(const std::string& secret); | 62 explicit DecryptionKey(const std::string& secret); |
62 ~DecryptionKey(); | 63 ~DecryptionKey(); |
63 | 64 |
64 // Creates the encryption key, and derives the WebM decryption key and HMAC. | 65 // Creates the encryption key, and derives the WebM decryption key and HMAC. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 static uint32 next_session_id_; | 113 static uint32 next_session_id_; |
113 | 114 |
114 DecryptorClient* const client_; | 115 DecryptorClient* const client_; |
115 | 116 |
116 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); | 117 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); |
117 }; | 118 }; |
118 | 119 |
119 } // namespace media | 120 } // namespace media |
120 | 121 |
121 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 122 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
OLD | NEW |