@is_connected
def mac(self, data, uid=None, algorithm=None):
    '\n        Get the message authentication code for data.\n\n        Args:\n            data (string): The data to be MACed.\n            uid (string): The unique ID of the managed object that is the key\n                to use for the MAC operation.\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the MAC.\n\n        Returns:\n            string: The unique ID of the managed object that is the key\n                to use for the MAC operation.\n            string: The data MACed\n\n        Raises:\n            ClientConnectionNotOpen: if the client connection is unusable\n            KmipOperationFailure: if the operation result is a failure\n            TypeError: if the input arguments are invalid\n        '
    if (not isinstance(data, six.binary_type)):
        raise TypeError('data must be bytes')
    if (uid is not None):
        if (not isinstance(uid, six.string_types)):
            raise TypeError('uid must be a string')
    if (algorithm is not None):
        if (not isinstance(algorithm, enums.CryptographicAlgorithm)):
            raise TypeError('algorithm must be a CryptographicAlgorithm enumeration')
    parameters_attribute = self._build_cryptographic_parameters({'cryptographic_algorithm': algorithm})
    result = self.proxy.mac(data, uid, parameters_attribute)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        uid = result.uuid.value
        mac_data = result.mac_data.value
        return (uid, mac_data)
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)
Get the message authentication code for data.

Args:
    data (string): The data to be MACed.
    uid (string): The unique ID of the managed object that is the key
        to use for the MAC operation.
    algorithm (CryptographicAlgorithm): An enumeration defining the
        algorithm to use to generate the MAC.

Returns:
    string: The unique ID of the managed object that is the key
        to use for the MAC operation.
    string: The data MACed

Raises:
    ClientConnectionNotOpen: if the client connection is unusable
    KmipOperationFailure: if the operation result is a failure
    TypeError: if the input arguments are invalid
@is_connected
def mac(self, data, uid=None, algorithm=None):
    '\n        Get the message authentication code for data.\n\n        Args:\n            data (string): The data to be MACed.\n            uid (string): The unique ID of the managed object that is the key\n                to use for the MAC operation.\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the MAC.\n\n        Returns:\n            string: The unique ID of the managed object that is the key\n                to use for the MAC operation.\n            string: The data MACed\n\n        Raises:\n            ClientConnectionNotOpen: if the client connection is unusable\n            KmipOperationFailure: if the operation result is a failure\n            TypeError: if the input arguments are invalid\n        '
    if (not isinstance(data, six.binary_type)):
        raise TypeError('data must be bytes')
    if (uid is not None):
        if (not isinstance(uid, six.string_types)):
            raise TypeError('uid must be a string')
    if (algorithm is not None):
        if (not isinstance(algorithm, enums.CryptographicAlgorithm)):
            raise TypeError('algorithm must be a CryptographicAlgorithm enumeration')
    parameters_attribute = self._build_cryptographic_parameters({'cryptographic_algorithm': algorithm})
    result = self.proxy.mac(data, uid, parameters_attribute)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        uid = result.uuid.value
        mac_data = result.mac_data.value
        return (uid, mac_data)
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)