OLD | NEW |
(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 MEDIA_CAST_UTILITY_CAST_DECRYPTION_HANDLER_H_ |
| 6 #define MEDIA_CAST_UTILITY_CAST_DECRYPTION_HANDLER_H_ |
| 7 |
| 8 // Helper class to handle decryption for the Cast library. |
| 9 #include <string> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string_piece.h" |
| 14 #include "base/threading/non_thread_safe.h" |
| 15 |
| 16 namespace crypto { |
| 17 class Encryptor; |
| 18 class SymmetricKey; |
| 19 } |
| 20 |
| 21 namespace media { |
| 22 namespace cast { |
| 23 |
| 24 class CastDecryptionHandler : public base::NonThreadSafe { |
| 25 public: |
| 26 CastDecryptionHandler(); |
| 27 ~CastDecryptionHandler(); |
| 28 |
| 29 bool Initialize(std::string aes_key, std::string aes_iv_mask); |
| 30 |
| 31 bool Decrypt(uint32 frame_id, |
| 32 const base::StringPiece& ciphertext, |
| 33 std::string* plaintext); |
| 34 |
| 35 bool initialized() const { return initialized_; } |
| 36 |
| 37 private: |
| 38 scoped_ptr<crypto::SymmetricKey> key_; |
| 39 std::string iv_mask_; |
| 40 scoped_ptr<crypto::Encryptor> decryptor_; |
| 41 bool initialized_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(CastDecryptionHandler); |
| 44 }; |
| 45 |
| 46 } // namespace cast |
| 47 } // namespace media |
| 48 |
| 49 #endif // MEDIA_CAST_UTILITY_CAST_DECRYPTION_HANDLER_H_ |
OLD | NEW |