Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Cryptolens/cryptolens-dotnet
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.035.3
Choose a base ref
...
head repository: Cryptolens/cryptolens-dotnet
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 28, 2022

  1. Copy the full SHA
    4f9ddc7 View commit details

Commits on Mar 29, 2022

  1. Fix for machine code on mac

    artemlos committed Mar 29, 2022
    Copy the full SHA
    25db6af View commit details

Commits on May 11, 2022

  1. Copy the full SHA
    293b29e View commit details
  2. Update TestMachineCode.cs

    artemlos committed May 11, 2022
    Copy the full SHA
    8d63975 View commit details

Commits on May 13, 2022

  1. Update docs

    artemlos committed May 13, 2022
    Copy the full SHA
    598717c View commit details
  2. Update v4036.md

    artemlos committed May 13, 2022
    Copy the full SHA
    15f1be1 View commit details

Commits on Jun 27, 2022

  1. Update Helpers.cs

    artemlos committed Jun 27, 2022
    Copy the full SHA
    933ddd0 View commit details
  2. Update Helpers.cs

    artemlos committed Jun 27, 2022
    Copy the full SHA
    6341887 View commit details
  3. Copy the full SHA
    ac83a3b View commit details
  4. Update Helpers.cs

    artemlos committed Jun 27, 2022
    Copy the full SHA
    abd98a0 View commit details

Commits on Jun 28, 2022

  1. Copy the full SHA
    bcee7bf View commit details
  2. Update Helpers.cs

    artemlos committed Jun 28, 2022
    Copy the full SHA
    12d9e67 View commit details

Commits on Jun 30, 2022

  1. Copy the full SHA
    ca0dcfe View commit details

Commits on Jul 4, 2022

  1. Copy the full SHA
    9d9b565 View commit details
  2. Update

    artemlos committed Jul 4, 2022
    Copy the full SHA
    7765f67 View commit details

Commits on Jul 26, 2022

  1. Update version numbers

    artemlos committed Jul 26, 2022
    Copy the full SHA
    8005030 View commit details

Commits on Aug 23, 2022

  1. Add a way to compute MAC

    artemlos committed Aug 23, 2022
    Copy the full SHA
    78ef6ce View commit details

Commits on Aug 26, 2022

  1. Update version number

    artemlos committed Aug 26, 2022
    Copy the full SHA
    d0edcd3 View commit details

Commits on Oct 17, 2022

  1. Copy the full SHA
    e562ef8 View commit details

Commits on Oct 21, 2022

  1. Change time server #78

    artemlos committed Oct 21, 2022
    Copy the full SHA
    ca2912b View commit details

Commits on Oct 24, 2022

  1. Update version numbers #78

    artemlos committed Oct 24, 2022
    Copy the full SHA
    7b072c8 View commit details

Commits on Nov 16, 2022

  1. Copy the full SHA
    7db4025 View commit details

Commits on Nov 24, 2022

  1. Add user-agent to requests

    artemlos committed Nov 24, 2022
    Copy the full SHA
    839d327 View commit details

Commits on Apr 12, 2023

  1. Potential fix for AD users

    artemlos committed Apr 12, 2023
    Copy the full SHA
    5fb8ff1 View commit details

Commits on Apr 13, 2023

  1. Copy the full SHA
    60e72dc View commit details

Commits on Apr 17, 2023

  1. Update README.md

    artemlos authored Apr 17, 2023
    Copy the full SHA
    929fa1f View commit details
  2. Update README.md

    artemlos authored Apr 17, 2023
    Copy the full SHA
    cc269cc View commit details
  3. Update version and tests

    artemlos committed Apr 17, 2023
    Copy the full SHA
    8dc6144 View commit details

Commits on May 24, 2023

  1. Add GetHarddiskId method

    artemlos committed May 24, 2023
    Copy the full SHA
    bb9cc5d View commit details

Commits on Sep 28, 2023

  1. Copy the full SHA
    c03a8d0 View commit details

Commits on Nov 23, 2023

  1. Copy the full SHA
    3984265 View commit details
  2. Update package version

    artemlos committed Nov 23, 2023
    Copy the full SHA
    3e55b83 View commit details

Commits on Feb 28, 2024

  1. Fix issue #81

    artemlos committed Feb 28, 2024
    Copy the full SHA
    57f9d0b View commit details
  2. Update version numbers

    artemlos committed Feb 28, 2024
    Copy the full SHA
    d85fa4c View commit details

Commits on Feb 29, 2024

  1. Patch GetMachineCodePI to migrate from WMIC (#82)

    * First
    
    * Update
    
    * Update version numbers
    artemlos authored Feb 29, 2024
    Copy the full SHA
    f2173d5 View commit details

Commits on Mar 12, 2024

  1. Update docs other languages

    artemlos committed Mar 12, 2024
    Copy the full SHA
    b26dcd2 View commit details

Commits on Jul 3, 2024

  1. Copy the full SHA
    542ef68 View commit details

Commits on Jul 5, 2024

  1. Copy the full SHA
    3990c4e View commit details
  2. Increase SDK version

    artemlos committed Jul 5, 2024
    Copy the full SHA
    52fc747 View commit details

Commits on Jul 10, 2024

  1. Update release notes

    artemlos committed Jul 10, 2024
    Copy the full SHA
    a5fc75e View commit details
  2. Copy the full SHA
    0edd644 View commit details

Commits on Jul 15, 2024

  1. Update docfx.json

    artemlos committed Jul 15, 2024
    Copy the full SHA
    d9132f0 View commit details

Commits on Aug 29, 2024

  1. Add User class and tests

    artemlos committed Aug 29, 2024
    Copy the full SHA
    80cec03 View commit details

Commits on Aug 30, 2024

  1. Update

    artemlos committed Aug 30, 2024
    Copy the full SHA
    eb9ffb6 View commit details
  2. Copy the full SHA
    77cdc2f View commit details

Commits on Jan 13, 2025

  1. Update GetMachineCode to return registry if UUID is not retrievable u…

    …sing PS (#84)
    
    * First commit to review
    
    * Update Helpers.cs
    
    * Update
    
    * Update Cryptolens.Licensing.CrossPlatform.csproj
    
    * Update
    
    * update
    
    * Update Cryptolens.Licensing.csproj
    
    * Update v4049.md
    
    * Update v4049.md
    
    * Update Helpers.cs
    
    * Update Helpers.cs
    artemlos authored Jan 13, 2025
    Copy the full SHA
    3d52bb0 View commit details
Showing with 822 additions and 60 deletions.
  1. +2 −1 Cryptolens.Licensing/Core/HelperExtensionMethods.cs
  2. +10 −1 Cryptolens.Licensing/Core/HelperMethods.cs
  3. +10 −6 Cryptolens.Licensing/Cryptolens.Licensing.CrossPlatform.csproj
  4. +11 −6 Cryptolens.Licensing/Cryptolens.Licensing.csproj
  5. +2 −1 Cryptolens.Licensing/LicenseRelated/ActivationData.cs
  6. +2 −1 Cryptolens.Licensing/LicenseRelated/Customer.cs
  7. +4 −2 Cryptolens.Licensing/LicenseRelated/LicenseKey.cs
  8. +79 −0 Cryptolens.Licensing/Models/WebAPIModels.cs
  9. +1 −1 Cryptolens.Licensing/SKM.cs
  10. +177 −27 Cryptolens.Licensing/SKMv3/Helpers.cs
  11. +23 −0 Cryptolens.Licensing/SKMv3/Key.cs
  12. +101 −0 Cryptolens.Licensing/SKMv3/User.cs
  13. +27 −1 Cryptolens.Licensing/articles/toc.yml
  14. +12 −0 Cryptolens.Licensing/articles/v4036.md
  15. +12 −0 Cryptolens.Licensing/articles/v4037.md
  16. +8 −0 Cryptolens.Licensing/articles/v4038.md
  17. +8 −0 Cryptolens.Licensing/articles/v4039.md
  18. +12 −0 Cryptolens.Licensing/articles/v4040.md
  19. +18 −0 Cryptolens.Licensing/articles/v4041.md
  20. +8 −0 Cryptolens.Licensing/articles/v4042.md
  21. +9 −0 Cryptolens.Licensing/articles/v4043.md
  22. +11 −0 Cryptolens.Licensing/articles/v4044.md
  23. +7 −0 Cryptolens.Licensing/articles/v4045.md
  24. +13 −0 Cryptolens.Licensing/articles/v4046.md
  25. +7 −0 Cryptolens.Licensing/articles/v4047.md
  26. +7 −0 Cryptolens.Licensing/articles/v4048.md
  27. +8 −0 Cryptolens.Licensing/articles/v4049.md
  28. +1 −1 Cryptolens.Licensing/docfx.json
  29. +1 −1 LICENSE
  30. +23 −0 README.md
  31. +23 −0 README.ru.md
  32. +24 −0 README.sv.md
  33. +1 −0 SKM Test/SKM Test.csproj
  34. +2 −2 SKM Test/TestData.Designer.cs
  35. +1 −1 SKM Test/TestData.resx
  36. +16 −0 SKM Test/TestHelpers.cs
  37. +25 −0 SKM Test/TestMachineCode.cs
  38. +17 −0 SKM Test/UnitTest1.cs
  39. +22 −8 SKM Test/V3/TestKey.cs
  40. +77 −0 SKM Test/V3/TestUser.cs
3 changes: 2 additions & 1 deletion Cryptolens.Licensing/Core/HelperExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
using System.Text;

using SKM.V3.Models;
using System.Globalization;

namespace SKM.V3.Internal
{
@@ -56,7 +57,7 @@ internal static class CultureSpecificToString
public static string ToStringCultureSpecific(this object source)
{
if (source is DateTime)
return ((DateTime)source).ToString(ConfigValues.DEFAULT_TIME_REPSENTATION);
return ((DateTime)source).ToString(ConfigValues.DEFAULT_TIME_REPSENTATION, CultureInfo.InvariantCulture);
else if (source is IEnumerable<DataObject>)
{
var obj = (IEnumerable<DataObject>)source;
11 changes: 10 additions & 1 deletion Cryptolens.Licensing/Core/HelperMethods.cs
Original file line number Diff line number Diff line change
@@ -63,7 +63,14 @@ public static T SendRequestToWebAPI3<T>(RequestModel inputParameters,
#if !KeepAliveDisabled
using (WebClient client = new WebClient())
{
NameValueCollection reqparm = new NameValueCollection();
try
{
var asm = AssemblyName.GetAssemblyName(Assembly.GetExecutingAssembly().Location);
client.Headers.Add(HttpRequestHeader.UserAgent, $"{asm.Name}/{asm.Version}");
}
catch (Exception ex) { }

NameValueCollection reqparm = new NameValueCollection();

foreach (var input in inputParams)
{
@@ -93,6 +100,7 @@ public static T SendRequestToWebAPI3<T>(RequestModel inputParameters,
reqparm.Add("modelversion", modelVersion.ToString());

// make sure .NET uses the default proxy set up on the client device.
client.Credentials = CredentialCache.DefaultCredentials;
client.Proxy = WebRequest.DefaultWebProxy;
client.Proxy.Credentials = CredentialCache.DefaultCredentials;

@@ -161,6 +169,7 @@ public static T SendRequestToWebAPI3<T>(RequestModel inputParameters,
reqparm.Add("modelversion", modelVersion.ToString());

// make sure .NET uses the default proxy set up on the client device.
client.Credentials = CredentialCache.DefaultCredentials;
client.Proxy = WebRequest.DefaultWebProxy;
client.Proxy.Credentials = CredentialCache.DefaultCredentials;

16 changes: 10 additions & 6 deletions Cryptolens.Licensing/Cryptolens.Licensing.CrossPlatform.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;net46;net47;net471;net48;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net35;net46;net47;net471;net48;netstandard2.0</TargetFrameworks>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Company>Cryptolens AB</Company>
<Authors>Cryptolens AB</Authors>
<Version>4.0.35.3</Version>
<AssemblyVersion>4.0.35.3</AssemblyVersion>
<FileVersion>4.0.35.3</FileVersion>
<Version>4.0.49</Version>
<AssemblyVersion>4.0.49.1</AssemblyVersion>
<FileVersion>4.0.49.1</FileVersion>
<Description>An API documentation can be found at https://help.cryptolens.io/api/dotnet/.

This is a client API that serves as an interface to Cryptolens Web API (app.cryptolens.io/docs/api/).
@@ -23,7 +23,7 @@ This library is aimed at users who plan to target environments other than Window
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>certifikat.pfx</AssemblyOriginatorKeyFile>
<PackageTags>licensing system, SKGL, serial key management, http://app.cryptolens.io/ , skgl extension, SKM Client API, cryptolens</PackageTags>
<PackageReleaseNotes>Release notes available at https://help.cryptolens.io/api/dotnet/articles/v4035.html</PackageReleaseNotes>
<PackageReleaseNotes>Release notes available at https://help.cryptolens.io/api/dotnet/articles/v4036.html</PackageReleaseNotes>


<PackageLicenseFile>LICENSE</PackageLicenseFile>
@@ -43,13 +43,17 @@ This library is aimed at users who plan to target environments other than Window
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net48'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' and $(DefineConstants.Contains('SYSTEM_MANAGEMENT'))">
<PackageReference Include="System.Management" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
</ItemGroup>


<ItemGroup Condition="('$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net35' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net45') and $(DefineConstants.Contains('SYSTEM_MANAGEMENT'))">
<Reference Include="System.Management" />
17 changes: 11 additions & 6 deletions Cryptolens.Licensing/Cryptolens.Licensing.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;net46;net47;net471;net48;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net35;net46;net47;net471;net48;netstandard2.0</TargetFrameworks>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Company>Cryptolens AB</Company>
<Authors>Cryptolens AB</Authors>
<Version>4.0.35.3</Version>
<AssemblyVersion>4.0.35.3</AssemblyVersion>
<FileVersion>4.0.35.3</FileVersion>
<Version>4.0.49</Version>
<AssemblyVersion>4.0.49.1</AssemblyVersion>
<FileVersion>4.0.49.1</FileVersion>
<Description>An API documentation can be found at https://help.cryptolens.io/api/dotnet/.

This is a client API that serves as an interface to Cryptolens Web API (app.cryptolens.io/docs/api/).
@@ -23,7 +23,7 @@ NB: There is also one for C++ (https://github.com/Cryptolens/cryptolens-cpp)</De
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>certifikat.pfx</AssemblyOriginatorKeyFile>
<PackageTags>licensing system, SKGL, serial key management, http://app.cryptolens.io/ , skgl extension, SKM Client API, cryptolens</PackageTags>
<PackageReleaseNotes>Release notes available at https://help.cryptolens.io/api/dotnet/articles/v4035.html</PackageReleaseNotes>
<PackageReleaseNotes>Release notes available at https://help.cryptolens.io/api/dotnet/articles/v4036.html</PackageReleaseNotes>

<DefineConstants>SYSTEM_MANAGEMENT</DefineConstants>

@@ -44,13 +44,18 @@ NB: There is also one for C++ (https://github.com/Cryptolens/cryptolens-cpp)</De
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net48'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' and $(DefineConstants.Contains('SYSTEM_MANAGEMENT'))">
<PackageReference Include="System.Management" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
</ItemGroup>



<ItemGroup Condition="('$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net35' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net45') and $(DefineConstants.Contains('SYSTEM_MANAGEMENT'))">
<Reference Include="System.Management" />
3 changes: 2 additions & 1 deletion Cryptolens.Licensing/LicenseRelated/ActivationData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;

namespace SKM.V3
{
@@ -30,7 +31,7 @@ public class ActivationData
public override string ToString()
{
if (this != null)
return Mid + "," + IP + "," + (Time.HasValue ? Time.Value.ToString(ConfigValues.DEFAULT_TIME_REPSENTATION) : "");
return Mid + "," + IP + "," + (Time.HasValue ? Time.Value.ToString(ConfigValues.DEFAULT_TIME_REPSENTATION, CultureInfo.InvariantCulture) : "");
return base.ToString();
}

3 changes: 2 additions & 1 deletion Cryptolens.Licensing/LicenseRelated/Customer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;

namespace SKM.V3
{
@@ -20,7 +21,7 @@ public class Customer
public override string ToString()
{
if (this != null)
return Name + "," + Email + "," + CompanyName + "," + Created.ToString(ConfigValues.DEFAULT_TIME_REPSENTATION);
return Name + "," + Email + "," + CompanyName + "," + Created.ToString(ConfigValues.DEFAULT_TIME_REPSENTATION, CultureInfo.InvariantCulture);
return base.ToString();
}

6 changes: 4 additions & 2 deletions Cryptolens.Licensing/LicenseRelated/LicenseKey.cs
Original file line number Diff line number Diff line change
@@ -307,10 +307,12 @@ public int DaysLeft(bool zeroIfExpired = false)
{
var remaining = Expires - DateTime.UtcNow;

int daysLeft = (int)Math.Ceiling(remaining.TotalSeconds / (3600 * 24));

if (zeroIfExpired)
return remaining.Days < 0 ? 0 : remaining.Days;
return daysLeft < 0 ? 0 : daysLeft;
else
return remaining.Days;
return daysLeft;

}

79 changes: 79 additions & 0 deletions Cryptolens.Licensing/Models/WebAPIModels.cs
Original file line number Diff line number Diff line change
@@ -423,6 +423,11 @@ public class GetCustomersModel : RequestModel
/// </summary>
public int Limit { get; set; }

/// <summary>
/// If this is set, you can use the CustomerId field to find a specific customer based on their integer Id.
/// </summary>
public int CustomerId { get; set; }

}
public class GetCustomersResult : BasicResult
{
@@ -463,6 +468,12 @@ public class AddCustomerResult : BasicResult
/// A link that allows the customer to create an account where they will see their licenses (in the customer dashboard).
/// </summary>
public string PortalLink { get; set; }

/// <summary>
/// The customer secret that can be used in some methods as an alternative way to authenticate customers.
/// You can read more about it in https://help.cryptolens.io/web-interface/customer-secret.
/// </summary>
public string Secret { get; set; }
}
public class DeactivateModel : KeyLockModel
{
@@ -498,6 +509,8 @@ public class KeyInfoModel : RequestModel
public int FieldsToReturn { get; set; }

public bool Metadata { get; set; }

public SignMethod SignMethod { get; set; }
}

public class CreateTrialKeyModel : RequestModel
@@ -1352,5 +1365,71 @@ public class AuthDetails
/// https://app.cryptolens.io/docs/api/v3/Versioning
/// </summary>
public int Version { get; set; }
}
public class LoginUserModel : RequestModel
{
public string UserName { get; set; }
public string Password { get; set; }
}

public class LoginUserResult : BasicResult
{
public List<LicenseKey> LicenseKeys { get; set; }
}
public class RegisterUserModel : RequestModel
{
public string UserName { get; set; }
public string Password { get; set; }
public int CustomerId { get; set; }
public string CustomerSecret { get; set; }
public string Email { get; set; }
}
public class AssociateUserModel : RequestModel
{
public string UserName { get; set; }
public int CustomerId { get; set; }

}
public class DissociateModel : RequestModel
{
public string UserName { get; set; }
}

public class GetUsersModel : RequestModel
{
public string UserName { get; set; }
public string Email { get; set; }
public int CustomerId { get; set; }
}
public class GetUsersResult : BasicResult
{
public List<UserObj> Users { get; set; }
}
public class UserObj
{
public string Username { get; set; }
public string Email { get; set; }
public DateTime Created { get; set; }
public int CustomerId { get; set; }
}
public class ChangePasswordModel : RequestModel
{
public string UserName { get; set; }
public string OldPassword { get; set; }
public string NewPassword { get; set; }
public string PasswordResetToken { get; set; }
public bool AdminMode { get; set; }
}
public class ResetPasswordModel : RequestModel
{
public string UserName { get; set; }
}
public class ResetPasswordResult : BasicResult
{
public string PasswordResetToken { get; set; }
}
public class RemoveUserModel : RequestModel
{
public string UserName { get; set; }
}
}
2 changes: 1 addition & 1 deletion Cryptolens.Licensing/SKM.cs
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ private static DateTime GetNetworkTime()
//By: @Nasreddine

//default Windows time server
const string ntpServer = "time.windows.com";
const string ntpServer = "pool.ntp.org";

// NTP message size - 16 bytes of the digest (RFC 2030)
var ntpData = new byte[48];
Loading