xbmc
DrmCryptoSession.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "AddonClass.h"
12 #include "Exception.h"
13 #include "commons/Buffer.h"
14 
15 #include <map>
16 #include <vector>
17 
18 namespace DRM
19 {
20  class CCryptoSession;
21 }
22 
23 namespace XBMCAddon
24 {
25 
26  typedef std::vector<char> charVec;
27 
28  namespace xbmcdrm
29  {
30 
31  XBMCCOMMONS_STANDARD_EXCEPTION(DRMException);
32 
33  //
95  class CryptoSession : public AddonClass
96  {
97  DRM::CCryptoSession* m_cryptoSession;
98  public:
99  CryptoSession(const String& UUID, const String& cipherAlgorithm, const String& macAlgorithm);
100  ~CryptoSession() override;
101 
102 #ifdef DOXYGEN_SHOULD_USE_THIS
103  // \anchor xbmcdrm_GetKeyRequest
135  GetKeyRequest(...);
136 #else
137  XbmcCommons::Buffer GetKeyRequest(const XbmcCommons::Buffer &init, const String &mimeType, bool offlineKey, const std::map<String, String> &optionalParameters);
138 #endif
139 
140 #ifdef DOXYGEN_SHOULD_USE_THIS
141  GetPropertyString(...);
156 #else
157  String GetPropertyString(const String &name);
158 #endif
159 
160 #ifdef DOXYGEN_SHOULD_USE_THIS
161  ProvideKeyResponse(...);
183 #else
184  String ProvideKeyResponse(const XbmcCommons::Buffer &response);
185 #endif
186 
187 #ifdef DOXYGEN_SHOULD_USE_THIS
188  RemoveKeys(...);
198 #else
199  void RemoveKeys();
200 #endif
201 
202 #ifdef DOXYGEN_SHOULD_USE_THIS
203  RestoreKeys(...);
218 #else
219  void RestoreKeys(const String& keySetId);
220 #endif
221 
222 #ifdef DOXYGEN_SHOULD_USE_THIS
223  SetPropertyString(...);
238 #else
239  void SetPropertyString(const String &name, const String &value);
240 #endif
241 
242 /*******************Crypto section *****************/
243 
244 #ifdef DOXYGEN_SHOULD_USE_THIS
245  Decrypt(...);
264 #else
265  XbmcCommons::Buffer Decrypt(const XbmcCommons::Buffer &cipherKeyId, const XbmcCommons::Buffer &input, const XbmcCommons::Buffer &iv);
266 #endif
267 
268 #ifdef DOXYGEN_SHOULD_USE_THIS
269  Encrypt(...);
288 #else
289  XbmcCommons::Buffer Encrypt(const XbmcCommons::Buffer &cipherKeyId, const XbmcCommons::Buffer &input, const XbmcCommons::Buffer &iv);
290 #endif
291 
292 #ifdef DOXYGEN_SHOULD_USE_THIS
293  Sign(...);
311 #else
312  XbmcCommons::Buffer Sign(const XbmcCommons::Buffer &macKeyId, const XbmcCommons::Buffer &message);
313 #endif
314 
315 #ifdef DOXYGEN_SHOULD_USE_THIS
316  Verify(...);
335 #else
336  bool Verify(const XbmcCommons::Buffer &macKeyId, const XbmcCommons::Buffer &message, const XbmcCommons::Buffer &signature);
337 #endif
338 
339  };
341  }
342 }
Definition: DrmCryptoSession.h:18
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: CryptoSession.h:23
Definition: DrmCryptoSession.h:95
This class is based on the java java.nio.Buffer class however, it does not implement the &#39;mark&#39; funct...
Definition: Buffer.h:79
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57