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

Side by Side Diff: media/cast/transport/transport_encryption_handler.h

Issue 138843011: Cast: Adding helper crypto classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
(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_TRANSPORT_TRANSPORT_ENCRYPTION_HANDLER_H_
6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_ENCRYPTION_HANDLER_H_
7
8 // Helper class to handle encryption for the Cast Transport library.
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/threading/non_thread_safe.h"
14
15 namespace crypto {
16 class Encryptor;
17 class SymmetricKey;
18 }
19
20 namespace media {
21 namespace cast {
22 namespace transport {
23
24 class TransportEncryptionHandler : public base::NonThreadSafe {
25 public:
26 TransportEncryptionHandler();
27 ~TransportEncryptionHandler();
28
29 bool Initialize(std::string aes_key, std::string aes_iv_mask);
30
31 bool Encrypt(uint32 frame_id, std::string data, std::string* encrypted_data);
32
33 bool initialized() const { return initialized_; }
34
35 private:
36 scoped_ptr<crypto::SymmetricKey> key_;
37 scoped_ptr<crypto::Encryptor> encryptor_;
38 std::string iv_mask_;
39 bool initialized_;
40
41 DISALLOW_COPY_AND_ASSIGN(TransportEncryptionHandler);
42 };
43
44 } // namespace transport
45 } // namespace cast
46 } // namespace media
47
48 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_ENCRYPTION_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698