def _build_key_attributes(self, algorithm, length, masks=None):
    algorithm_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_ALGORITHM, algorithm)
    length_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_LENGTH, length)
    mask_value = [enums.CryptographicUsageMask.ENCRYPT, enums.CryptographicUsageMask.DECRYPT]
    if masks:
        mask_value.extend(masks)
    mask_value = list(set(mask_value))
    mask_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, mask_value)
    return [algorithm_attribute, length_attribute, mask_attribute]
def _build_key_attributes(self, algorithm, length, masks=None):
    algorithm_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_ALGORITHM, algorithm)
    length_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_LENGTH, length)
    mask_value = [enums.CryptographicUsageMask.ENCRYPT, enums.CryptographicUsageMask.DECRYPT]
    if masks:
        mask_value.extend(masks)
    mask_value = list(set(mask_value))
    mask_attribute = self.attribute_factory.create_attribute(enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK, mask_value)
    return [algorithm_attribute, length_attribute, mask_attribute]