Esempio n. 1
0
        public static void WriteEncodedLicensingDllHash()
        {
            IHashingProvider hashingProvider = new HashingProvider();
            IEncodingService encodingService = new EncodingService();

            string hash = hashingProvider.HashFile(Directory.GetCurrentDirectory() + "\\WaveTech.Scutex.Licensing.dll");

            Console.WriteLine(encodingService.Encode(hash));
        }
Esempio n. 2
0
        public LicenseHelper()
        {
            asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
            hashingProvider             = new HashingProvider();
            encodingService             = new EncodingService();
            objectSerializationProvider = new ObjectSerializationProvider();
            symmetricEncryptionProvider = new SymmetricEncryptionProvider();
            clientLicenseRepository     = new ClientLicenseRepository(objectSerializationProvider, symmetricEncryptionProvider);
            clientLicenseService        = new ClientLicenseService(clientLicenseRepository);
            serviceStatusProvider       = new ServiceStatusProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);
            numberDataGenerator         = new NumberDataGenerator();
            packingService             = new PackingService(numberDataGenerator);
            hardwareFingerprintService = new HardwareFingerprintService(new WmiDataProvider(), new HashingProvider());
            keygen            = new KeyGenerator(symmetricEncryptionProvider, asymmetricEncryptionProvider, hashingProvider);
            keyGeneratorLarge = new Scutex.Generators.StaticKeyGeneratorLarge.KeyGenerator(symmetricEncryptionProvider, asymmetricEncryptionProvider, hashingProvider, hardwareFingerprintService);

            licenseActiviationProvider = new LicenseActiviationProvider(asymmetricEncryptionProvider, symmetricEncryptionProvider, objectSerializationProvider);
            service                = new LicenseKeyService(keygen, keyGeneratorLarge, packingService, clientLicenseService);
            productsProvider       = new ProductsProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);
            zipCompressionProvider = new ZipCompressionProvider();
            wcfPackagingService    = new WcfPackagingService(zipCompressionProvider);

            //licenseSetsRepository = new LicenseSetsRepository();

            //licenseSetService = new LicenseSetService();
            //licenseService = new LicenseService();

            License          = new License();
            License.Name     = "UnitTest License";
            License.UniqueId = Guid.NewGuid();
            License.KeyPair  = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);

            //string path = System.Reflection.Assembly.GetAssembly(typeof(LicenseHelper)).Location;
            string path = Helper.AssemblyDirectory;

            DllHash   = encodingService.Encode(hashingProvider.HashFile(path + "\\WaveTech.Scutex.Licensing.dll"));
            PublicKey = encodingService.Encode(License.KeyPair.PublicKey);
        }
Esempio n. 3
0
        public static void WriteLicensingDllHash()
        {
            IHashingProvider hashingProvider = new HashingProvider();

            Console.WriteLine(hashingProvider.HashFile(Directory.GetCurrentDirectory() + "\\WaveTech.Scutex.Licensing.dll"));
        }