> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET: CreateKeyModel

> Signatures, models and behavior for SKM.V3.Models.CreateKeyModel in the .NET SDK 4.0.54.

Parameters used by [`CreateKey(string, CreateKeyModel)`](/libraries/dotnet-reference/methods/key#create-key-4082be0b70).

**Namespace:** `SKM.V3.Models`\
**Version:** 4.0.54. Both packages; all six documented target frameworks.

<CodeGroup>
  ```csharp C# theme={null}
  public class CreateKeyModel : AddCustomerModel
  ```

  ```vb VB.NET theme={null}
  Public Class CreateKeyModel Inherits AddCustomerModel
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/CreateKey)

## Inherited SDK Members

* [`AllowActivationManagement`](/libraries/dotnet-reference/models/add-customer-model#allow-activation-management-994da019d9)
* [`AllowMultipleUserAssociation`](/libraries/dotnet-reference/models/add-customer-model#allow-multiple-user-association-ccdb7c9039)
* [`CompanyName`](/libraries/dotnet-reference/models/add-customer-model#company-name-a24aa2df54)
* [`Email`](/libraries/dotnet-reference/models/add-customer-model#email-bd0a43bd8b)
* [`EnableCustomerAssociation`](/libraries/dotnet-reference/models/add-customer-model#enable-customer-association-ef19c1e721)
* [`Name`](/libraries/dotnet-reference/models/add-customer-model#name-4a4df78578)
* [`LicenseServerUrl`](/libraries/dotnet-reference/models/request-model#license-server-url-67581aa5cb)

## Properties

<a id="add-or-use-existing-customer-86c619fa5b" />

### AddOrUseExistingCustomer

If set to true, this method will either associate the license with a new customer (if no customer with the specified email exists) or with an existing one (the customer whose email is the same as the 'Email' parameter of this method). **Note:** In addition to CreateKey permission, you also need to add 'AddCustomer' permission. The same idea applies as for the option 'NewCustomer', i.e. this method can be called with the same parameters as [Add Customer](/api-reference/generated/AddCustomer) method. If a customer already exists, the license will be associated with an existing customer whose email address equals to 'Email' parameter. Properties of an existing customer will not be updated.

<CodeGroup>
  ```csharp C# theme={null}
  public bool AddOrUseExistingCustomer { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property AddOrUseExistingCustomer As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="allowed-machines-5e9786a56e" />

### AllowedMachines

A list (separated by new lines) of machine codes that will be prioritized during key activation.

<CodeGroup>
  ```csharp C# theme={null}
  public string AllowedMachines { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property AllowedMachines As String
  ```
</CodeGroup>

**Type:** `string`

<a id="block-184fc8ee62" />

### Block

Blocks the key from being accessed by the Activation method.

<CodeGroup>
  ```csharp C# theme={null}
  public bool Block { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property Block As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="customer-id-5316da3320" />

### CustomerId

The customer id of the customer that was associated with the license key.

<CodeGroup>
  ```csharp C# theme={null}
  public int CustomerId { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property CustomerId As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="f1-5ac3f405eb" />

### F1

The feature 1 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F1 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F1 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f2-c325d9e00d" />

### F2

The feature 2 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F2 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F2 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f3-1cdad0f6de" />

### F3

The feature 3 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F3 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F3 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f4-7f584f3d2a" />

### F4

The feature 4 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F4 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F4 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f5-16039249f4" />

### F5

The feature 5 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F5 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F5 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f6-7c334620eb" />

### F6

The feature 6 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F6 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F6 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f7-c8f3cc6ede" />

### F7

The feature 7 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F7 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F7 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="f8-cfb203d867" />

### F8

The feature 8 (either true or false)

<CodeGroup>
  ```csharp C# theme={null}
  public bool F8 { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property F8 As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="max-no-of-machines-cb6dc03643" />

### MaxNoOfMachines

In order to restrict the number of computers that can use the same key, you can set enable this feature by enter a number greater than zero. This number represents the maximum number of computers that can activate the key.

<CodeGroup>
  ```csharp C# theme={null}
  public int MaxNoOfMachines { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property MaxNoOfMachines As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="new-customer-15f1d4ed29" />

### NewCustomer

If set to true, you will be able to add the paramters that apply to [Add Customer](/api-reference/generated/AddCustomer) method to this method so that a customer is automatically created together with the license key. When setting this parameter to true, please ensure that CustomerId is not set to anything.**Note:** In addition to CreateKey permission, you also need to add 'AddCustomer' permission.

<CodeGroup>
  ```csharp C# theme={null}
  public bool NewCustomer { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property NewCustomer As Boolean
  ```
</CodeGroup>

**Type:** `bool`

<a id="no-of-keys-c4f5b86b26" />

### NoOfKeys

The number of keys to generate.

<CodeGroup>
  ```csharp C# theme={null}
  public int NoOfKeys { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property NoOfKeys As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="notes-95285f5f4c" />

### Notes

Additional notes about the license key. Max. 500 chars.

<CodeGroup>
  ```csharp C# theme={null}
  [DefaultValue("")]
  public string Notes { get; set; }
  ```

  ```vb VB.NET theme={null}
  <DefaultValue("")>
  Public Property Notes As String
  ```
</CodeGroup>

**Type:** `string`

<a id="period-ca20e73a86" />

### Period

The number of days, from today, the license key should be valid. Note, you will still be able to activate keys that have "expired". You can enforce the expiration date in the client program. Please see [Keys that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire) tutorial.

<CodeGroup>
  ```csharp C# theme={null}
  public int Period { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property Period As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="product-id-a9946d1377" />

### ProductId

the product id (=\*\*\[ProductId] \*\*)

<CodeGroup>
  ```csharp C# theme={null}
  public int ProductId { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property ProductId As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="reseller-id-a37c7fd159" />

### ResellerId

The id of the [reseller](/api-reference/generated/model/Reseller) that should be associated with this license key.

<CodeGroup>
  ```csharp C# theme={null}
  public int ResellerId { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property ResellerId As Integer
  ```
</CodeGroup>

**Type:** `int`

<a id="trial-activation-05b58d95cf" />

### TrialActivation

Enables or disables [Trial activation](https://help.cryptolens.io/web-interface/trial-activation)

<CodeGroup>
  ```csharp C# theme={null}
  public bool TrialActivation { get; set; }
  ```

  ```vb VB.NET theme={null}
  Public Property TrialActivation As Boolean
  ```
</CodeGroup>

**Type:** `bool`

## Constructors

<a id="ctor-44ff436b82" />

### CreateKeyModel()

Creates an empty CreateKeyModel object. This constructor does not send an API request.

<CodeGroup>
  ```csharp C# theme={null}
  public CreateKeyModel()
  ```

  ```vb VB.NET theme={null}
  Public Sub New()
  ```
</CodeGroup>

[.NET SDK Reference](/libraries/dotnet-api) · [Reviewed Source Revision](https://github.com/Cryptolens/cryptolens-dotnet/tree/30aaf399ba53d9a111bee896c35bf557fa219394)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.