@is_connected
def create_key_pair(self, algorithm, length, operation_policy_name=None, public_name=None, public_usage_mask=None, private_name=None, private_usage_mask=None):
    '\n        Create an asymmetric key pair on a KMIP appliance.\n\n        Args:\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the key pair.\n            length (int): The length in bits for the key pair.\n            operation_policy_name (string): The name of the operation policy\n                to use for the new key pair. Optional, defaults to None.\n            public_name (string): The name to give the public key.\n                                  Optional, defaults to None.\n            public_usage_mask (list): A list of CryptographicUsageMask\n                enumerations indicating how the public key should be used.\n                Optional, defaults to None.\n            private_name (string): The name to give the public key.\n                                   Optional, defaults to None.\n            private_usage_mask (list): A list of CryptographicUsageMask\n                enumerations indicating how the private key should be used.\n                Optional, defaults to None.\n\n        Returns:\n            string: The uid of the newly created public key.\n            string: The uid of the newly created private 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')
    common_attributes = self._build_common_attributes(operation_policy_name)
    key_attributes = self._build_key_attributes(algorithm, length)
    key_attributes.extend(common_attributes)
    template = cobjects.CommonTemplateAttribute(attributes=key_attributes)
    public_template = None
    names = None
    if public_name:
        names = self._build_name_attribute(name=public_name)
    attrs = []
    if public_usage_mask:
        attrs = [self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, public_usage_mask)]
    if (names or attrs):
        public_template = cobjects.PublicKeyTemplateAttribute(names=names, attributes=attrs)
    private_template = None
    names = None
    if private_name:
        names = self._build_name_attribute(name=private_name)
    attrs = []
    if private_usage_mask:
        attrs = [self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, private_usage_mask)]
    if (names or attrs):
        private_template = cobjects.PrivateKeyTemplateAttribute(names=names, attributes=attrs)
    result = self.proxy.create_key_pair(common_template_attribute=template, private_key_template_attribute=private_template, public_key_template_attribute=public_template)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        public_uid = result.public_key_uuid.value
        private_uid = result.private_key_uuid.value
        return (public_uid, private_uid)
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)
Create an asymmetric key pair on a KMIP appliance.

Args:
    algorithm (CryptographicAlgorithm): An enumeration defining the
        algorithm to use to generate the key pair.
    length (int): The length in bits for the key pair.
    operation_policy_name (string): The name of the operation policy
        to use for the new key pair. Optional, defaults to None.
    public_name (string): The name to give the public key.
                          Optional, defaults to None.
    public_usage_mask (list): A list of CryptographicUsageMask
        enumerations indicating how the public key should be used.
        Optional, defaults to None.
    private_name (string): The name to give the public key.
                           Optional, defaults to None.
    private_usage_mask (list): A list of CryptographicUsageMask
        enumerations indicating how the private key should be used.
        Optional, defaults to None.

Returns:
    string: The uid of the newly created public key.
    string: The uid of the newly created private 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_key_pair(self, algorithm, length, operation_policy_name=None, public_name=None, public_usage_mask=None, private_name=None, private_usage_mask=None):
    '\n        Create an asymmetric key pair on a KMIP appliance.\n\n        Args:\n            algorithm (CryptographicAlgorithm): An enumeration defining the\n                algorithm to use to generate the key pair.\n            length (int): The length in bits for the key pair.\n            operation_policy_name (string): The name of the operation policy\n                to use for the new key pair. Optional, defaults to None.\n            public_name (string): The name to give the public key.\n                                  Optional, defaults to None.\n            public_usage_mask (list): A list of CryptographicUsageMask\n                enumerations indicating how the public key should be used.\n                Optional, defaults to None.\n            private_name (string): The name to give the public key.\n                                   Optional, defaults to None.\n            private_usage_mask (list): A list of CryptographicUsageMask\n                enumerations indicating how the private key should be used.\n                Optional, defaults to None.\n\n        Returns:\n            string: The uid of the newly created public key.\n            string: The uid of the newly created private 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')
    common_attributes = self._build_common_attributes(operation_policy_name)
    key_attributes = self._build_key_attributes(algorithm, length)
    key_attributes.extend(common_attributes)
    template = cobjects.CommonTemplateAttribute(attributes=key_attributes)
    public_template = None
    names = None
    if public_name:
        names = self._build_name_attribute(name=public_name)
    attrs = []
    if public_usage_mask:
        attrs = [self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, public_usage_mask)]
    if (names or attrs):
        public_template = cobjects.PublicKeyTemplateAttribute(names=names, attributes=attrs)
    private_template = None
    names = None
    if private_name:
        names = self._build_name_attribute(name=private_name)
    attrs = []
    if private_usage_mask:
        attrs = [self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, private_usage_mask)]
    if (names or attrs):
        private_template = cobjects.PrivateKeyTemplateAttribute(names=names, attributes=attrs)
    result = self.proxy.create_key_pair(common_template_attribute=template, private_key_template_attribute=private_template, public_key_template_attribute=public_template)
    status = result.result_status.value
    if (status == enums.ResultStatus.SUCCESS):
        public_uid = result.public_key_uuid.value
        private_uid = result.private_key_uuid.value
        return (public_uid, private_uid)
    else:
        reason = result.result_reason.value
        message = result.result_message.value
        raise exceptions.KmipOperationFailure(status, reason, message)