docs: def _generate_data_key(self, algorithm, encryption_context):
          """Generates data key and returns :class:`aws_encryption_sdk.structures.DataKey`.
  
          :param algorithm: Algorithm on which to base data key
          :type algorithm: aws_encryption_sdk.identifiers.Algorithm
          :param dict encryption_context: Encryption context to use in encryption
          :returns: Generated data key
          :rtype: aws_encryption_sdk.structures.DataKey
          """
          plaintext_data_key = os.urandom(algorithm.kdf_input_len)
          encrypted_data_key = self._encrypt_data_key(
              data_key=RawDataKey(key_provider=self.key_provider, data_key=plaintext_data_key),
              algorithm=algorithm,
              encryption_context=encryption_context,
          )
          return DataKey(
              key_provider=encrypted_data_key.key_provider,
              data_key=plaintext_data_key,
              encrypted_data_key=encrypted_data_key.encrypted_data_key,
          )