Ejemplo n.º 1
0
        public static Storage GetStorage(LicenseOptions options)
        {
            var details = LoadCompanyAndProduct(options);

              var pathBuilder = new RegistryPathBuilder();
              var subkey = pathBuilder.GetPath(details);
              var key = Registry.CurrentUser.OpenSubKey(subkey, RegistryKeyPermissionCheck.ReadWriteSubTree)
                ?? Registry.CurrentUser.CreateSubKey(subkey, RegistryKeyPermissionCheck.ReadWriteSubTree);
              var io = new RegistryIO(key);

              var encryptor = GetEncryptor(options);
              var serializer = new LicenseSerializer();

              return new SecureStorage(io, encryptor, serializer);
        }
Ejemplo n.º 2
0
        public static Storage GetStorage(LicenseOptions options)
        {
            var details = LoadCompanyAndProduct(options);

            var pathBuilder = new RegistryPathBuilder();
            var subkey      = pathBuilder.GetPath(details);
            var key         = Registry.CurrentUser.OpenSubKey(subkey, RegistryKeyPermissionCheck.ReadWriteSubTree)
                              ?? Registry.CurrentUser.CreateSubKey(subkey, RegistryKeyPermissionCheck.ReadWriteSubTree);
            var io = new RegistryIO(key);

            var encryptor  = GetEncryptor(options);
            var serializer = new LicenseSerializer();

            return(new SecureStorage(io, encryptor, serializer));
        }