public void options_constructor_should_not_throw_an_exception() { LicensingManagerOptions options = new LicensingManagerOptions(); options.DataFileLocation = @"C:\Temp\Scutex\sxu.dll"; options.DllHash = "123"; options.PublicKey = "123"; LicensingManager lm = new LicensingManager(this, options); }
public static void TestLicensingManagerWithOptions() { LicensingManagerOptions options = new LicensingManagerOptions { DataFileLocation = @"C:\Temp\Scutex\License.lic", PublicKey = "31|32|36|32|30|34|33|37|31|35|34|35|34|36|36|34|37|32|37|39|39|36|31|35|33|32|36|34|39|36|37|30|38|34|36|30|38|31|32|34|31|36|34|31|30|35|33|39|31|31|38|32|34|30|32|36|37|32|37|37|35|32|31|31|31|33|33|32|33|34|34|31|30|36|36|31|38|39|39|34|31|35|32|38|33|38|30|31|39|33|39|32|37|38|38|30|39|38|30|31|30|34|38|38|30|35|31|38|32|38|35|37|31|31|31|34|32|35|33|33|37|32|30|32|37|30|32|37|35|35|31|32|39|36|37|39|35|34|35|30|37|39|34|39|30|30|35|35|35|35|37|36|39|35|39|34|34|36|39|39|38|36|36|31|30|31|31|30|31|38|32|39|32|37|35|36|37|34|31|39|36|37|32|36|35|32|35|34|37|31|38|31|38|33|38|34|34|39|39|35|34|30|34|36|34|30|36|39|35|30|34|35|35|37|31|39|37|31|37|32|34|37|30|32|33|37|37|33|39|32|36|33|7c|36|35|35|33|37", DllHash = "43|44|2d|36|42|2d|31|45|2d|30|30|2d|42|43|2d|45|32|2d|41|33|2d|31|33|2d|31|33|2d|34|38|2d|39|35|2d|44|32|2d|46|44|2d|43|42|2d|33|45|2d|35|36|2d|38|34|2d|33|30|2d|42|32|2d|46|46", KillOnError = false }; LicensingManager LicensingManager = new LicensingManager(null, options); LicensingManager.Validate(InteractionModes.Gui); }
/// <summary> /// Override constructor to instantiate the Licensing Manager and /// set options for its use. /// </summary> /// <remarks> /// This constructor is useful when calling Scutex from an instance /// where there is no running application or objects that can be /// used to run a attribute check. For example a .Net Component or /// Control. /// </remarks> /// <param name="instance"> /// Reference to an object were the required attributes can be located /// </param> /// <param name="options"> /// Options to override the default Licensing Manager behavior /// </param> public LicensingManager(object instance, LicensingManagerOptions options) { if (options != null) { _options = options; _killOnError = _options.KillOnError; } this.instance = instance; Bootstrapper.Configure(); InterfaceInteraction = new TrialInterfaceInteraction(); hashingProvider = ObjectLocator.GetInstance<IHashingProvider>(); encodingService = ObjectLocator.GetInstance<IEncodingService>(); licenseManagerService = ObjectLocator.GetInstance<ILicenseManagerService>(); _clientLicenseService = ObjectLocator.GetInstance<IClientLicenseService>(); _comBypassProvider = ObjectLocator.GetInstance<IComBypassProvider>(); _registerService = ObjectLocator.GetInstance<IRegisterService>(); SetCriticalVerificationData(); VerifyLicensingAssembly(); }