class DynamicEncryptedMessageMaker
Defined at line 76 of file ../../third_party/cobalt/src/lib/util/dynamic_encrypted_message_maker.h
Thread-safe, hot-swappable EncryptedMessageMaker that validates key expiration
against a system wall clock before encrypting each message.
Public Methods
void DynamicEncryptedMessageMaker (SystemClockInterface * clock)
Constructs an uninitialized DynamicEncryptedMessageMaker. Calls to Encrypt()
will return false until UpdateKey() provides a valid key.
|clock| must be non-null and must outlive this instance.
void DynamicEncryptedMessageMaker (ParsedKey initial_key, SystemClockInterface * clock)
Constructs a DynamicEncryptedMessageMaker initialized with |initial_key|.
|clock| must be non-null and must outlive this instance.
bool Encrypt (const google::protobuf::MessageLite & message, EncryptedMessage * encrypted_message)
void UpdateKey (ParsedKey new_key)
bool IsExpired ()
Returns true if the maker is initialized with a key whose expiration
timestamp has passed. Returns false if the maker is uninitialized; callers
should also check IsInitialized() to determine whether the maker has a
valid key ready for encryption.
uint32_t key_index ()
Defined at line 92 of file ../../third_party/cobalt/src/lib/util/dynamic_encrypted_message_maker.h
int64_t expiration_timestamp_secs ()
Expiration timestamp of the current key in seconds since the Unix epoch,
compared against SystemClockInterface::now(). Returns 0 if uninitialized.
Defined at line 99 of file ../../third_party/cobalt/src/lib/util/dynamic_encrypted_message_maker.h
bool IsInitialized ()
Defined at line 104 of file ../../third_party/cobalt/src/lib/util/dynamic_encrypted_message_maker.h