![]() |
LicenseSpring .Net SDK 7.22.0
Easily add Software Licensing to your application
|
LicenseManager interface More...
Public Member Functions | |
ILicense | ActivateAirGapLicense (string confirmationCode, string policyPath, string licenseKey, uint policyId) |
Verify Confirmation code and activate air gap license using given license policy or policies More... | |
ILicense | ActivateLicense (LicenseID licenseID) |
Activate license with given LicenseID More... | |
ILicense | ActivateLicense (string data, string accountCode=null, bool useToken=false) |
Activate license using SSO More... | |
ILicense | ActivateLicenseOffline (string activationResponseFile=null) |
Activate provided offline activation file More... | |
bool | ChangePassword (LicenseID licenseID, string newPassword) |
Change user password, meaningful only for user-based products. More... | |
void | ClearLocalStorage () |
BaseManager.ClearLocalStorage | |
ILicense | CurrentLicense () |
BaseManager.CurrentLicense | |
string | GetAirGapActivationCode (string initializationCode, string licenseKey) |
Get air gap Activation code. More... | |
string[] | GetAllVersions (LicenseID licenseID) |
Get all available versions for given license More... | |
ILicenseUser[] | GetCustomerLicenseUsers (Customer customer) |
Get license users information by customer More... | |
InstallationFile | GetInstallationFile (LicenseID licenseID, IInstallationFileOptions options=null) |
Get InstallationFile information for given license More... | |
string | GetOfflineActivationFile (LicenseID licenseID, string activationRequestFile=null) |
Creates offline activation file request More... | |
ProductDetails | GetProductDetails () |
Retrieve information about a product from LicenseSpring backend. More... | |
string | GetSSOUrl (string accountCode=null, bool useToken=false) |
Get URL for Single sign-on license activation. More... | |
LicenseID | GetTrialLicense (Customer user=null, string licensePolicy=null) |
Request trial license from LicenseSpring More... | |
LicenseID | GetTrialLicense (string email) |
Request trial license from LicenseSpring platform. Overloaded method. More... | |
void | Initialize (Configuration configuration, ILicenseStorage storage=null) |
BaseManager.Initialize | |
bool | IsInitialized () |
BaseManager.IsInitialized | |
bool | IsOnline (bool throwExceptions=false) |
Helper method, it checks connection to the LicenseSpring backend More... | |
string | LicenseFilePath () |
BaseManager.LicenseFilePath | |
ILicense | RelinkLicense (DeviceIDAlgorithm deviceIdAlgorithm, string userPassword=null) |
This method helps upgrade to new device id algorithm. It deactivates current license with old device id and activate with new one. Internet connection is required. More... | |
ILicense | ReloadLicense () |
BaseManager.ReloadLicense | |
Properties | |
string | DataLocation [get, set] |
BaseManager.DataLocation | |
string | LicenseFileName [get, set] |
BaseManager.LicenseFileName | |
LicenseManager interface
ILicense LicenseSpring.ILicenseManager.ActivateAirGapLicense | ( | string | confirmationCode, |
string | policyPath, | ||
string | licenseKey, | ||
uint | policyId | ||
) |
Verify Confirmation code and activate air gap license using given license policy or policies
Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.
confirmationCode | Code received from the air gap activation portal |
policyPath | Policy file path or folder path which contains several policy files |
licenseKey | License key |
policyId | Id of the license policy |
LicenseSpring.LicenseSpringException | If feature not supported for current target Framework |
System.InvalidOperationException | Thrown when license manager is not initialized |
System.IO.FileNotFoundException | Thrown when provided file not found |
LicenseSpring.SignatureMismatchException | In case signature in activation file is not valid |
LicenseSpring.ActivationFileException | In case invalid activation file provided, check inner exception for more details. |
LicenseSpring.AirGapActivationException | In case confirmation code from the air gap activation portal is invalid. |
Activate license with given LicenseID
licenseID | License ID: license key or email and password. |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseNotFoundException | In case provided license was not found |
LicenseSpring.LicenseActivationException | In case something went wrong with license activation |
LicenseSpring.LicenseDisabledException | Thrown when license is disabled |
LicenseSpring.LicenseExpiredException | Thrown when license is expired |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
System.Security.Authentication.InvalidCredentialException | In case of wrong credential |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.CannotBeActivatedNowException | If start_date field is set for the license and current date is behind start date |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
ILicense LicenseSpring.ILicenseManager.ActivateLicense | ( | string | data, |
string | accountCode = null , |
||
bool | useToken = false |
||
) |
Activate license using SSO
You can omit accountCode param if you already set customer account code through the Configuration.
data | id_token or code you get after user authorization with SSO |
accountCode | Customer account code |
useToken | Whether to use id_token instead of code for activation |
System.InvalidOperationException | Thrown when license manager is not initialized or token is empty |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseNotFoundException | In case provided license was not found |
LicenseSpring.LicenseActivationException | In case something went wrong with license activation |
LicenseSpring.LicenseDisabledException | Thrown when license is disabled |
LicenseSpring.LicenseExpiredException | Thrown when license is expired |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
System.Security.Authentication.InvalidCredentialException | In case of wrong credential |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.CannotBeActivatedNowException | If start_date field is set for the license and current date is behind start date |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
ILicense LicenseSpring.ILicenseManager.ActivateLicenseOffline | ( | string | activationResponseFile = null | ) |
Activate provided offline activation file
activationResponseFile | Activation response file path, null means use default path (Desktop) |
System.InvalidOperationException | Thrown when license manager is not initialized |
System.IO.FileNotFoundException | Thrown when provided file not found |
LicenseSpring.SignatureMismatchException | In case signature in activation file is not valid |
LicenseSpring.ActivationFileException | In case invalid activation file provided, check inner exception for more details. |
Implemented in LicenseSpring.LicenseManager.
bool LicenseSpring.ILicenseManager.ChangePassword | ( | LicenseID | licenseID, |
string | newPassword | ||
) |
Change user password, meaningful only for user-based products.
licenseID | LicenseID: email and password |
newPassword | New password |
System.Security.Authentication.InvalidCredentialException | In case of wrong password |
LicenseSpring.PasswordChangeNotAllowedException | If changing password is forbidden |
LicenseSpring.MissingParametersException | If password or newPassword is empty |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
string LicenseSpring.ILicenseManager.GetAirGapActivationCode | ( | string | initializationCode, |
string | licenseKey | ||
) |
Get air gap Activation code.
Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.
initializationCode | Code received from the air gap activation portal. |
licenseKey | License key of air gap license. |
LicenseSpring.LicenseSpringException | If feature not supported for current target Framework |
Implemented in LicenseSpring.LicenseManager.
string[] LicenseSpring.ILicenseManager.GetAllVersions | ( | LicenseID | licenseID | ) |
Get all available versions for given license
licenseID | License id: license key or user id. |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseNotFoundException | In case provided license was not found |
LicenseSpring.LicenseStateException | In case provided license is not active |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
ILicenseUser[] LicenseSpring.ILicenseManager.GetCustomerLicenseUsers | ( | Customer | customer | ) |
Get license users information by customer
Please note that email is required field in Customer information
customer | Customer information |
LicenseSpring.InvalidAuthMethodException | Thrown when this method is called for key-based product. |
LicenseSpring.CustomerNotFoundException | In case customer does not exist. |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring server error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
InstallationFile LicenseSpring.ILicenseManager.GetInstallationFile | ( | LicenseID | licenseID, |
IInstallationFileOptions | options = null |
||
) |
Get InstallationFile information for given license
licenseID | License id: license key or user id. |
options | Providing InstallationFileOptions you can filter install files by channel or environment, you can also specify needed version. |
This param is optional, if not provided then last available version assumed from default channel.
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseNotFoundException | In case provided license was not found |
LicenseSpring.LicenseStateException | In case provided license is not active |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
string LicenseSpring.ILicenseManager.GetOfflineActivationFile | ( | LicenseID | licenseID, |
string | activationRequestFile = null |
||
) |
Creates offline activation file request
licenseID | License ID, license key or email and password. |
activationRequestFile | Activation request file path, null means use default path (Desktop) |
System.InvalidOperationException | Thrown when license manager is not initialized |
Implemented in LicenseSpring.LicenseManager.
ProductDetails LicenseSpring.ILicenseManager.GetProductDetails | ( | ) |
Retrieve information about a product from LicenseSpring backend.
In offline mode data will be retrieved from license file if present.
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the server |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
string LicenseSpring.ILicenseManager.GetSSOUrl | ( | string | accountCode = null , |
bool | useToken = false |
||
) |
Get URL for Single sign-on license activation.
You can omit accountCode param if you already set customer account code through the Configuration.
accountCode | Customer account code |
useToken | Boolean value indicating whether this method should create the redirect_uri with id_token instead of code. |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.LicenseSpringException | In case customer account code is not set in Configuration and param |
LicenseSpring.ProductNotFoundException | In case product does not exist on the server |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
LicenseID LicenseSpring.ILicenseManager.GetTrialLicense | ( | Customer | user = null , |
string | licensePolicy = null |
||
) |
Request trial license from LicenseSpring
If you provide user information please note that user's email is required field
user | User information. Optional param for key-based products, but required for user-based products. |
licensePolicy | License policy code. Optional param, if omited the default license policy for the product will be used. |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
LicenseID LicenseSpring.ILicenseManager.GetTrialLicense | ( | string | ) |
Request trial license from LicenseSpring platform. Overloaded method.
User's email |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.ProductNotFoundException | In case product does not exist on the platform |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.LicenseManager.
bool LicenseSpring.ILicenseManager.IsOnline | ( | bool | throwExceptions = false | ) |
Helper method, it checks connection to the LicenseSpring backend
throwExceptions | Boolean value indicating whether this method should throw exceptions, by default it's false. |
System.InvalidOperationException | Thrown when license manager is not initialized |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
Implemented in LicenseSpring.LicenseManager.
ILicense LicenseSpring.ILicenseManager.RelinkLicense | ( | DeviceIDAlgorithm | deviceIdAlgorithm, |
string | userPassword = null |
||
) |
This method helps upgrade to new device id algorithm. It deactivates current license with old device id and activate with new one. Internet connection is required.
Local license is required to call this method. May throw exceptions the same as ActivateLicense and License.Deactivate methods.
deviceIdAlgorithm | Device id algorithm generation you would like to upgrade to |
userPassword | Optional param, user password, meaningful only for user-based licenses |
System.InvalidOperationException | Thrown when there is no local license exists |
LicenseSpring.ProductMismatchException | If license product code does not correspond to configuration product code |
LicenseSpring.DeviceNotLicensedException | If reactivation is not possible (e.g. license copied from other device) |
Implemented in LicenseSpring.LicenseManager.