1 #ifndef CASTKEY_TYPES_H_ 2 #define CASTKEY_TYPES_H_ 3 4 #include <cstdint> 5 #include <map> 6 #include <vector> 7 8 namespace castkeydrm { 9 10 const uint8_t kBlockSize = 16; // AES_BLOCK_SIZE; 11 typedef uint8_t KeyId[kBlockSize]; 12 typedef uint8_t Iv[kBlockSize]; 13 14 typedef std::map<std::vector<uint8_t>, std::vector<uint8_t>> KeyMap; 15 16 #define CASTKEY_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 17 TypeName(const TypeName&) = delete; \ 18 void operator=(const TypeName&) = delete; 19 20 #define CASTKEY_DISALLOW_COPY_AND_ASSIGN_AND_NEW(TypeName) \ 21 TypeName() = delete; \ 22 TypeName(const TypeName&) = delete; \ 23 void operator=(const TypeName&) = delete; 24 25 enum CdmResponseType : int32_t { 26 OK = 0, 27 ERROR_NO_LICENSE = 1, 28 ERROR_SESSION_NOT_OPENED = 3, 29 ERROR_CANNOT_HANDLE = 4, 30 ERROR_INVALID_STATE = 5, 31 BAD_VALUE = 6, 32 ERROR_DECRYPT = 11, 33 ERROR_UNKNOWN = 12, 34 ERROR_INSUFFICIENT_SECURITY = 13, 35 ERROR_FRAME_TOO_LARGE = 14, 36 ERROR_SESSION_LOST_STATE = 15, 37 ERROR_RESOURCE_CONTENTION = 16, 38 }; 39 40 enum CdmKeyType : int32_t { 41 KEY_TYPE_OFFLINE = 0, 42 KEY_TYPE_STREAMING = 1, 43 KEY_TYPE_RELEASE = 2, 44 }; 45 46 } // namespace castkeydrm 47 48 #endif // CASTKEY_TYPES_H_