@is_connected
def create(self, algorithm, length, operation_policy_name=None, name=None, cryptographic_usage_mask=None):
    '\n        Create a symmetric key on a KMIP appliance.\n\n        Args:\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the symmetric key.\n            length (int): The length in bits for the symmetric key.\n            operation_policy_name (string): The name of the operation policy\n                to use for the new symmetric key. Optional, defaults to None\n            name (string): The name to give the key. Optional, defaults to None\n            cryptographic_usage_mask (list): list of enumerations of crypto\n                usage mask passing to the symmetric key. Optional, defaults to\n                None\n\n        Returns:\n            string: The uid of the newly created symmetric key.\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(algorithm, enums.CryptographicAlgorithm)):
        raise TypeError('algorithm must be a CryptographicAlgorithm enumeration')
    elif ((not isinstance(length, six.integer_types)) or (length <= 0)):
        raise TypeError('length must be a positive integer')
    if (cryptographic_usage_mask is not None):
        if ((not isinstance(cryptographic_usage_mask, list)) or (all((isinstance(item, enums.CryptographicUsageMask) for item in cryptographic_usage_mask)) is False)):
            raise TypeError('cryptographic_usage_mask must be a list of CryptographicUsageMask enumerations')
    common_attributes = self._build_common_attributes(operation_policy_name)
    key_attributes = self._build_key_attributes(algorithm, length, cryptographic_usage_mask)
    key_attributes.extend(common_attributes)
    if name:
        key_attributes.extend(self._build_name_attribute(name))
    template = cobjects.TemplateAttribute(attributes=key_attributes)
    result = self.proxy.create(enums.ObjectType.SYMMETRIC_KEY, template)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        uid = result.uuid.value
        return uid
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)
Create a symmetric key on a KMIP appliance.

Args:
    algorithm (CryptographicAlgorithm): An enumeration defining the
        algorithm to use to generate the symmetric key.
    length (int): The length in bits for the symmetric key.
    operation_policy_name (string): The name of the operation policy
        to use for the new symmetric key. Optional, defaults to None
    name (string): The name to give the key. Optional, defaults to None
    cryptographic_usage_mask (list): list of enumerations of crypto
        usage mask passing to the symmetric key. Optional, defaults to
        None

Returns:
    string: The uid of the newly created symmetric key.

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 create(self, algorithm, length, operation_policy_name=None, name=None, cryptographic_usage_mask=None):
    '\n        Create a symmetric key on a KMIP appliance.\n\n        Args:\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the symmetric key.\n            length (int): The length in bits for the symmetric key.\n            operation_policy_name (string): The name of the operation policy\n                to use for the new symmetric key. Optional, defaults to None\n            name (string): The name to give the key. Optional, defaults to None\n            cryptographic_usage_mask (list): list of enumerations of crypto\n                usage mask passing to the symmetric key. Optional, defaults to\n                None\n\n        Returns:\n            string: The uid of the newly created symmetric key.\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(algorithm, enums.CryptographicAlgorithm)):
        raise TypeError('algorithm must be a CryptographicAlgorithm enumeration')
    elif ((not isinstance(length, six.integer_types)) or (length <= 0)):
        raise TypeError('length must be a positive integer')
    if (cryptographic_usage_mask is not None):
        if ((not isinstance(cryptographic_usage_mask, list)) or (all((isinstance(item, enums.CryptographicUsageMask) for item in cryptographic_usage_mask)) is False)):
            raise TypeError('cryptographic_usage_mask must be a list of CryptographicUsageMask enumerations')
    common_attributes = self._build_common_attributes(operation_policy_name)
    key_attributes = self._build_key_attributes(algorithm, length, cryptographic_usage_mask)
    key_attributes.extend(common_attributes)
    if name:
        key_attributes.extend(self._build_name_attribute(name))
    template = cobjects.TemplateAttribute(attributes=key_attributes)
    result = self.proxy.create(enums.ObjectType.SYMMETRIC_KEY, template)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        uid = result.uuid.value
        return uid
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)