/* Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary source code may only be used and distributed under the Widevine Master License Agreement. */ #ifndef OEMCRYPTO_TA_OEMCRYPTO_SESSION_KEY_TABLE_H_ #define OEMCRYPTO_TA_OEMCRYPTO_SESSION_KEY_TABLE_H_ #include "oemcrypto_key.h" #include "oemcrypto_session.h" /* Finds the key from the key table corresponding to the given |is_content_key| with the given |key_id| and |key_id_length|. Returns either the key if there is a match or NULL otherwise. |key_id_length| must be > 0 and |is_content_key| can only be false if the session has an OEMCrypto_EntitlementLicense. Caller retains ownership of all parameters and they must not be NULL. */ CryptoKey* FindKeyFromTable(OEMCryptoSession* session, bool is_content_key, const uint8_t* key_id, uint32_t key_id_length); /* For the given |session|'s license_type, updates the associated keys to the duration in the |key_control_block|. Caller retains ownership of all pointers and they must not be NULL. */ void UpdateDurationForAllKeys(OEMCryptoSession* session, KeyControlBlock key_control_block); #endif /* OEMCRYPTO_TA_OEMCRYPTO_SESSION_KEY_TABLE_H_ */