1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-24 22:26:07 +03:00

Added login with encrypted private key

This commit is contained in:
MisCusi2023 2023-05-04 01:56:57 -07:00
parent 1907061064
commit 6e4b3f7c01
12 changed files with 47 additions and 29 deletions

View File

@ -28,6 +28,8 @@ namespace ProxySuper.Core.Models.Hosts
public string PrivateKeyPath { get; set; }
public string PrivateKeyPassPhrase { get; set; }
public LocalProxy Proxy { get; set; }
public LoginSecretType SecretType { get; set; }

View File

@ -802,13 +802,13 @@ namespace ProxySuper.Core.Services
if (_host.SecretType == LoginSecretType.PrivateKey)
{
PrivateKeyFile keyFile;
if (string.IsNullOrEmpty(_host.Password))
if (string.IsNullOrEmpty(_host.PrivateKeyPassPhrase))
{
keyFile = new PrivateKeyFile(_host.PrivateKeyPath);
}
else
{
keyFile = new PrivateKeyFile(_host.PrivateKeyPath, _host.Password);
keyFile = new PrivateKeyFile(_host.PrivateKeyPath, _host.PrivateKeyPassPhrase);
}
authMethods.Add(new PrivateKeyAuthenticationMethod(_host.UserName, keyFile));
}

View File

@ -17,7 +17,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300" />
<RowDefinition Height="330" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
@ -36,6 +36,7 @@
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -105,7 +106,18 @@
Converter={StaticResource SecretTypeConverter},
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
}"
Content="{DynamicResource HostUploadSecretKey}" />
Content="{DynamicResource HostUploadSecretKey}" />
<Label Content="{DynamicResource HostSertTypePrivateKeyPassPhrase}" Grid.Row="7" Grid.Column="0" />
<TextBox Grid.Row="7" Grid.Column="1"
Width="170"
Text="{Binding Host.PrivateKeyPassPhrase}"
IsEnabled="{
Binding Host.SecretType,
Converter={StaticResource SecretTypeConverter},
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
}"
VerticalContentAlignment="Center" />
</Grid>
</GroupBox>

View File

@ -40,7 +40,7 @@
<sys:String x:Key="MainDataGridColumnActionViewConfig">ViewConfig</sys:String>
<sys:String x:Key="MainDataGridColumnActionDelete">Delete</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortUp">Up</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortDone">Done</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortDone">Down</sys:String>
<!--Editor Window-->
@ -54,6 +54,7 @@
<sys:String x:Key="HostUploadSecretKey">UploadKey</sys:String>
<sys:String x:Key="HostSertTypePassword">Password</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">PrivateKey</sys:String>
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">PKPassword</sys:String>
<sys:String x:Key="ProxyGroupName">Proxy</sys:String>

View File

@ -3,20 +3,20 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--common-->
<sys:String x:Key="Random">Random</sys:String>
<sys:String x:Key="Random">تصادفی</sys:String>
<sys:String x:Key="Save">ذخیره</sys:String>
<sys:String x:Key="SaveAndInstall">ذخیره و نصب</sys:String>
<sys:String x:Key="SaveAs">ذخیره به عنوان</sys:String>
<sys:String x:Key="Install">نصب</sys:String>
<sys:String x:Key="Settings">تنظیمات</sys:String>
<sys:String x:Key="ReadmeWebsiteDemo">The following is a static web page connection provided by netizens, please check whether there is an index.html file by yourself</sys:String>
<sys:String x:Key="ReadmeWebsiteDemo">موارد زیر یک اتصال صفحه وب ثابت است که توسط کاربران اینترنتی ارائه شده است، لطفاً بررسی کنید که آیا فایل index.html توسط خودتان وجود دارد یا خیر.</sys:String>
<!--Main Menu-->
<sys:String x:Key="MainMenuAddHost">Add Host</sys:String>
<sys:String x:Key="MainMenuActions">Actions</sys:String>
<sys:String x:Key="MainMenuActionsExportSettings">Export Settings</sys:String>
<sys:String x:Key="MainMenuActionsExportSubscribe">Export Subscribe</sys:String>
<sys:String x:Key="MainMenuActionsGetRoot">Get Root</sys:String>
<sys:String x:Key="MainMenuAddHost">میزبان اضافه کنید</sys:String>
<sys:String x:Key="MainMenuActions">عمل کنند</sys:String>
<sys:String x:Key="MainMenuActionsExportSettings">پیکربندی صادرات</sys:String>
<sys:String x:Key="MainMenuActionsExportSubscribe">اشتراک صادرات</sys:String>
<sys:String x:Key="MainMenuActionsGetRoot">اکانت روت را فعال کنید</sys:String>
<sys:String x:Key="MainMenuLanguage">زبان(Language)</sys:String>
<sys:String x:Key="MainMenuLanguageEn">English</sys:String>
@ -24,23 +24,23 @@
<sys:String x:Key="MainMenuLanguageTw">正體</sys:String>
<sys:String x:Key="MainMenuLanguageFr">فارسی</sys:String>
<sys:String x:Key="MainMenuHelper">Helper</sys:String>
<sys:String x:Key="MainMenuHelper">یاور</sys:String>
<sys:String x:Key="MainMenuHelperGithub">Github</sys:String>
<sys:String x:Key="MainMenuHelperUseRoot">UseRoot</sys:String>
<sys:String x:Key="MainMenuHelperCertQuestion">CertQuestion</sys:String>
<sys:String x:Key="MainMenuHelperPrivateKey">PrivateKey</sys:String>
<sys:String x:Key="MainMenuHelperUseRoot">اکانت روت را فعال کنید</sys:String>
<sys:String x:Key="MainMenuHelperCertQuestion">در مورد گواهینامه</sys:String>
<sys:String x:Key="MainMenuHelperPrivateKey">در مورد سوال</sys:String>
<!--Main DataGrid-->
<sys:String x:Key="MainDataGridColumnTag">برچسب</sys:String>
<sys:String x:Key="MainDataGridColumnAddress">آدرس</sys:String>
<sys:String x:Key="MainDataGridColumnType">نوع</sys:String>
<sys:String x:Key="MainDataGridColumnAction">Action</sys:String>
<sys:String x:Key="MainDataGridColumnAction">عمل کنند</sys:String>
<sys:String x:Key="MainDataGridColumnActionInstall">نصب</sys:String>
<sys:String x:Key="MainDataGridColumnActionEdit">ویرایش</sys:String>
<sys:String x:Key="MainDataGridColumnActionViewConfig">ViewConfig</sys:String>
<sys:String x:Key="MainDataGridColumnActionDelete">Delete</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortUp">Up</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortDone">Done</sys:String>
<sys:String x:Key="MainDataGridColumnActionViewConfig">مشاهده پیکربندی</sys:String>
<sys:String x:Key="MainDataGridColumnActionDelete">حذف</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortUp">بالاا</sys:String>
<sys:String x:Key="MainDataGridColumnActionSortDone">پایین</sys:String>
<!--Editor Window-->
@ -50,10 +50,11 @@
<sys:String x:Key="HostUserName">نام کاربری</sys:String>
<sys:String x:Key="HostPassword">رمز عبور</sys:String>
<sys:String x:Key="HostPort">پورت</sys:String>
<sys:String x:Key="HostSecretType">SecretType</sys:String>
<sys:String x:Key="HostUploadSecretKey">UploadKey</sys:String>
<sys:String x:Key="HostSecretType">نوع تأیید ورود</sys:String>
<sys:String x:Key="HostUploadSecretKey">کلید آپلود</sys:String>
<sys:String x:Key="HostSertTypePassword">رمز عبور</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">PrivateKey</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">کلید خصوصی</sys:String>
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">رمز عبور PK</sys:String>
<sys:String x:Key="ProxyGroupName">پروکسی</sys:String>

View File

@ -55,6 +55,7 @@
<sys:String x:Key="HostUploadSecretKey">上傳Key</sys:String>
<sys:String x:Key="HostSertTypePassword">密碼</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">私鑰</sys:String>
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">私鑰密碼</sys:String>
<sys:String x:Key="ProxyGroupName">代理</sys:String>
<sys:String x:Key="ProxyAddress">IP/地址</sys:String>

View File

@ -56,6 +56,7 @@
<sys:String x:Key="HostUploadSecretKey">上传Key</sys:String>
<sys:String x:Key="HostSertTypePassword">密码</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">私钥</sys:String>
<sys:String x:Key="HostSertTypePrivateKeyPassPhrase">私钥密码</sys:String>
<sys:String x:Key="ProxyGroupName">代理</sys:String>
<sys:String x:Key="ProxyAddress">IP/地址</sys:String>

View File

@ -11,7 +11,7 @@
BorderBrush="#eee"
Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen"
Title="BrookEditorView" Height="600" Width="1000">
Title="BrookEditorView" Height="640" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310" />

View File

@ -11,7 +11,7 @@
BorderBrush="#eee"
Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen"
Title="Hysteria编辑配置" Height="600" Width="1000">
Title="Hysteria编辑配置" Height="640" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310" />

View File

@ -11,7 +11,7 @@
BorderBrush="#eee"
Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen"
Title="MTProto-Go编辑配置" Height="600" Width="1000">
Title="MTProto-Go编辑配置" Height="640" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310" />

View File

@ -11,7 +11,7 @@
BorderBrush="#eee"
Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen"
Title="NaiveProxy编辑配置" Height="600" Width="1000">
Title="NaiveProxy编辑配置" Height="640" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310" />

View File

@ -11,7 +11,7 @@
BorderBrush="#eee"
Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen"
Title="Trojan-Go编辑配置" Height="600" Width="1000">
Title="Trojan-Go编辑配置" Height="640" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310" />