Selaa lähdekoodia

银企直连参数加密程序

dujj 2 vuotta sitten
commit
21c9ed2daa
55 muutettua tiedostoa jossa 941 lisäystä ja 0 poistoa
  1. BIN
      .vs/AuthorizationSign/v15/.suo
  2. 0 0
      .vs/AuthorizationSign/v15/Server/sqlite3/db.lock
  3. BIN
      .vs/AuthorizationSign/v15/Server/sqlite3/storage.ide
  4. 25 0
      AuthorizationSign.sln
  5. 94 0
      AuthorizationSign/AuthorizationSign.csproj
  6. 7 0
      AuthorizationSign/AuthorizationSign.csproj.user
  7. 32 0
      AuthorizationSign/Base64Helper.cs
  8. BIN
      AuthorizationSign/Cn.Ubingo.Security/BouncyCastle.Crypto.dll
  9. BIN
      AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.Interop.dll
  10. BIN
      AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Core.dll
  11. BIN
      AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Data.dll
  12. BIN
      AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Key.dll
  13. 40 0
      AuthorizationSign/Form1.Designer.cs
  14. 19 0
      AuthorizationSign/Form1.cs
  15. 64 0
      AuthorizationSign/MD5Helper.cs
  16. 40 0
      AuthorizationSign/NewRsaHelper.cs
  17. 39 0
      AuthorizationSign/Program.cs
  18. 36 0
      AuthorizationSign/Properties/AssemblyInfo.cs
  19. 71 0
      AuthorizationSign/Properties/Resources.Designer.cs
  20. 117 0
      AuthorizationSign/Properties/Resources.resx
  21. 30 0
      AuthorizationSign/Properties/Settings.Designer.cs
  22. 7 0
      AuthorizationSign/Properties/Settings.settings
  23. 290 0
      AuthorizationSign/RsaHelper.cs
  24. BIN
      AuthorizationSign/bin/Debug/AuthorizationSign.exe
  25. BIN
      AuthorizationSign/bin/Debug/AuthorizationSign.pdb
  26. BIN
      AuthorizationSign/bin/Debug/BouncyCastle.Crypto.dll
  27. BIN
      AuthorizationSign/bin/Debug/Cn.Ubingo.Security.Interop.dll
  28. BIN
      AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Core.dll
  29. BIN
      AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Data.dll
  30. BIN
      AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Key.dll
  31. 1 0
      AuthorizationSign/bin/Debug/rsa.txt
  32. BIN
      AuthorizationSign/bin/Release/AuthorizationSign.exe
  33. BIN
      AuthorizationSign/bin/Release/AuthorizationSign.pdb
  34. BIN
      AuthorizationSign/bin/Release/BouncyCastle.Crypto.dll
  35. BIN
      AuthorizationSign/bin/Release/Cn.Ubingo.Security.Interop.dll
  36. BIN
      AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Core.dll
  37. BIN
      AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Data.dll
  38. BIN
      AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Key.dll
  39. BIN
      AuthorizationSign/obj/Debug/AuthorizationSign.Properties.Resources.resources
  40. 0 0
      AuthorizationSign/obj/Debug/AuthorizationSign.csproj.CopyComplete
  41. 1 0
      AuthorizationSign/obj/Debug/AuthorizationSign.csproj.CoreCompileInputs.cache
  42. 13 0
      AuthorizationSign/obj/Debug/AuthorizationSign.csproj.FileListAbsolute.txt
  43. BIN
      AuthorizationSign/obj/Debug/AuthorizationSign.csproj.GenerateResource.cache
  44. BIN
      AuthorizationSign/obj/Debug/AuthorizationSign.exe
  45. BIN
      AuthorizationSign/obj/Debug/AuthorizationSign.pdb
  46. BIN
      AuthorizationSign/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  47. BIN
      AuthorizationSign/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  48. BIN
      AuthorizationSign/obj/Release/AuthorizationSign.Properties.Resources.resources
  49. 0 0
      AuthorizationSign/obj/Release/AuthorizationSign.csproj.CopyComplete
  50. 1 0
      AuthorizationSign/obj/Release/AuthorizationSign.csproj.CoreCompileInputs.cache
  51. 14 0
      AuthorizationSign/obj/Release/AuthorizationSign.csproj.FileListAbsolute.txt
  52. BIN
      AuthorizationSign/obj/Release/AuthorizationSign.csproj.GenerateResource.cache
  53. BIN
      AuthorizationSign/obj/Release/AuthorizationSign.csprojAssemblyReference.cache
  54. BIN
      AuthorizationSign/obj/Release/AuthorizationSign.exe
  55. BIN
      AuthorizationSign/obj/Release/AuthorizationSign.pdb

BIN
.vs/AuthorizationSign/v15/.suo


+ 0 - 0
.vs/AuthorizationSign/v15/Server/sqlite3/db.lock


BIN
.vs/AuthorizationSign/v15/Server/sqlite3/storage.ide


+ 25 - 0
AuthorizationSign.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.1267
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizationSign", "AuthorizationSign\AuthorizationSign.csproj", "{E0155A3B-42A2-4214-A239-1D0D629749BF}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{E0155A3B-42A2-4214-A239-1D0D629749BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E0155A3B-42A2-4214-A239-1D0D629749BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E0155A3B-42A2-4214-A239-1D0D629749BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E0155A3B-42A2-4214-A239-1D0D629749BF}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {7CD30E57-37F0-41DC-B71E-F2987A248828}
+	EndGlobalSection
+EndGlobal

+ 94 - 0
AuthorizationSign/AuthorizationSign.csproj

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E0155A3B-42A2-4214-A239-1D0D629749BF}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>AuthorizationSign</RootNamespace>
+    <AssemblyName>AuthorizationSign</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="BouncyCastle.Crypto">
+      <HintPath>Cn.Ubingo.Security\BouncyCastle.Crypto.dll</HintPath>
+    </Reference>
+    <Reference Include="Cn.Ubingo.Security.RSA.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=09e65832abe9f999, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>Cn.Ubingo.Security\Cn.Ubingo.Security.RSA.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="Cn.Ubingo.Security.RSA.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=09e65832abe9f999, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>Cn.Ubingo.Security\Cn.Ubingo.Security.RSA.Data.dll</HintPath>
+    </Reference>
+    <Reference Include="Cn.Ubingo.Security.RSA.Key, Version=1.0.0.0, Culture=neutral, PublicKeyToken=09e65832abe9f999, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>Cn.Ubingo.Security\Cn.Ubingo.Security.RSA.Key.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Base64Helper.cs" />
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MD5Helper.cs" />
+    <Compile Include="NewRsaHelper.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="RsaHelper.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 7 - 0
AuthorizationSign/AuthorizationSign.csproj.user

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <StartArguments>
+    </StartArguments>
+  </PropertyGroup>
+</Project>

+ 32 - 0
AuthorizationSign/Base64Helper.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AuthorizationSign
+{
+    public class Base64Helper
+    {
+        /// <summary>
+        /// base64 解密
+        /// </summary>
+        /// <param name="encode"></param>
+        /// <param name="result"></param>
+        /// <returns></returns>
+        public static string DecodeBase64(string result)
+        {
+            string decode = "";
+            Encoding encode = Encoding.UTF8;
+            byte[] bytes = Convert.FromBase64String(result);
+            try
+            {
+                decode = encode.GetString(bytes);
+            }
+            catch
+            {
+                decode = result;
+            }
+            return decode;
+        }
+    }
+}

BIN
AuthorizationSign/Cn.Ubingo.Security/BouncyCastle.Crypto.dll


BIN
AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.Interop.dll


BIN
AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Core.dll


BIN
AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Data.dll


BIN
AuthorizationSign/Cn.Ubingo.Security/Cn.Ubingo.Security.RSA.Key.dll


+ 40 - 0
AuthorizationSign/Form1.Designer.cs

@@ -0,0 +1,40 @@
+namespace AuthorizationSign
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Text = "Form1";
+        }
+
+        #endregion
+    }
+}
+

+ 19 - 0
AuthorizationSign/Form1.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace AuthorizationSign
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 64 - 0
AuthorizationSign/MD5Helper.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security.Cryptography;
+using System.Text;
+namespace AuthorizationSign
+{
+    public class MD5Helper
+    {
+        /// <summary>
+        /// 计算字节数组的 MD5 值
+        /// </summary>
+        /// <param name="buffer"></param>
+        /// <returns></returns>
+        public static string CalcMD5(byte[] buffer)
+        {
+            using (MD5 md5 = MD5.Create())
+            {
+                byte[] md5Bytes = md5.ComputeHash(buffer);
+                return BytesToString(md5Bytes);
+            }
+        }
+
+        /// <summary>
+        /// 将得到的 MD5 字节数组转成 字符串
+        /// </summary>
+        /// <param name="md5Bytes"></param>
+        /// <returns></returns>
+        private static string BytesToString(byte[] md5Bytes)
+        {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < md5Bytes.Length; i++)
+            {
+                sb.Append(md5Bytes[i].ToString("X2"));
+            }
+            return sb.ToString();
+        }
+
+        /// <summary>
+        /// 计算字符串的 MD5 值
+        /// </summary>
+        /// <param name="str"></param>
+        /// <returns></returns>
+        public static string CalcMD5(string str)
+        {
+            byte[] buffer = Encoding.UTF8.GetBytes(str);
+            return CalcMD5(buffer);
+        }
+
+        /// <summary>
+        /// 计算流的 MD5 值
+        /// </summary>
+        /// <param name="stream"></param>
+        /// <returns></returns>
+        public static string CalcMD5(Stream stream)
+        {
+            using (MD5 md5 = MD5.Create())
+            {
+                byte[] buffer = md5.ComputeHash(stream);
+                return BytesToString(buffer);
+            }
+        }
+    }
+}

+ 40 - 0
AuthorizationSign/NewRsaHelper.cs

@@ -0,0 +1,40 @@
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace AuthorizationSign
+{
+    public class NewRsaHelper
+    {
+        //public const string ASN_PUBLIC_KEY = @"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMivG439/MBZoeZlWDo5So0Y5lMcw7QOPkvNqtVMhuThVtlLKjmg5AdT2oZejAQojlq5kHEhhRSFAsALzEaRCLJmf+8JwmvIBg8n/Vr8z4ALyfsrpSrU/3J/USC+K2f8OAFutj7WD0H21xY8KcvTTQmJ+hy6VKb8C6Ma324vmxOwIDAQAB";
+        public const string ASN_PUBLIC_KEY = @"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZ82s9MOWq4J18jYs08ceUiyw/QOh4mdUdNz7Tv7IPZCR3BQy6sEmJ9ZI1cLU6VJAdDKY4TAswC/Ul18/GXyCq3dmOBncFiRey/ShQ78J3aIgogQLwMLdIH+tM/CeZDNRwRpYJ5CNI5hu4S73qnc+J1yL5MByp5QHcBBX6S9KdnwIDAQAB";
+        /// <summary>
+        /// RSA公钥格式转换,java->.net
+        /// </summary>
+        /// <param name="publicKey"></param>
+        /// <returns></returns>
+        public static string RSAPublicKeyJava2DotNet(string publicKey)
+        {
+            RsaKeyParameters publicKeyParam = (RsaKeyParameters)PublicKeyFactory.CreateKey(Convert.FromBase64String(publicKey));
+            return string.Format("<RSAKeyValue><Modulus>{0}</Modulus><Exponent>{1}</Exponent></RSAKeyValue>",
+                Convert.ToBase64String(publicKeyParam.Modulus.ToByteArrayUnsigned()),
+                Convert.ToBase64String(publicKeyParam.Exponent.ToByteArrayUnsigned()));
+        }
+
+        public static string Encrypt(string content)
+        {
+            string publickey = RSAPublicKeyJava2DotNet(ASN_PUBLIC_KEY);
+            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
+            byte[] cipherbytes;
+            rsa.FromXmlString(publickey);
+            cipherbytes = rsa.Encrypt(Convert.FromBase64String(content), false);
+
+            return Convert.ToBase64String(cipherbytes);
+        }
+
+    }
+}

+ 39 - 0
AuthorizationSign/Program.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using System.IO;
+
+namespace AuthorizationSign
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main(string[] args)
+        {
+            if (args == null || args.Length < 1) return;
+            string DecodeStr = Base64Helper.DecodeBase64(args[0]);
+            string mw = "";
+            string error = "";
+            if (GetGeneAuthorizationSign(DecodeStr, out mw, out error))
+            {
+                File.WriteAllText(Path.Combine(Application.StartupPath, "rsa.txt"), mw);
+            }
+            return;
+        }
+
+        private static bool GetGeneAuthorizationSign(string Plaintext, out string Ciphertext, out string ErrorStr)
+        {
+            Ciphertext = "";
+            ErrorStr = "";
+            string md5 = MD5Helper.CalcMD5(Plaintext).ToLower();
+            //string AuthorizationSign = RsaHelper.EncryptData(RSAKeyTypes.ASNKey, md5);
+            string AuthorizationSign = NewRsaHelper.Encrypt(md5);
+            Ciphertext = AuthorizationSign;
+            return true;
+        }
+    }
+}

+ 36 - 0
AuthorizationSign/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("AuthorizationSign")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AuthorizationSign")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("e0155a3b-42a2-4214-a239-1d0d629749bf")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
AuthorizationSign/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace AuthorizationSign.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AuthorizationSign.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   覆盖当前线程的 CurrentUICulture 属性
+        ///   使用此强类型的资源类的资源查找。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
AuthorizationSign/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
AuthorizationSign/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace AuthorizationSign.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
AuthorizationSign/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 290 - 0
AuthorizationSign/RsaHelper.cs


BIN
AuthorizationSign/bin/Debug/AuthorizationSign.exe


BIN
AuthorizationSign/bin/Debug/AuthorizationSign.pdb


BIN
AuthorizationSign/bin/Debug/BouncyCastle.Crypto.dll


BIN
AuthorizationSign/bin/Debug/Cn.Ubingo.Security.Interop.dll


BIN
AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Core.dll


BIN
AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Data.dll


BIN
AuthorizationSign/bin/Debug/Cn.Ubingo.Security.RSA.Key.dll


+ 1 - 0
AuthorizationSign/bin/Debug/rsa.txt

@@ -0,0 +1 @@
+Vh+1zsd3rsPdiFjtY2yePxD0Vy6TeGZMquEfy/KyFIuiVxkLicpdpXWS3+wo715QjElUC8HFzkeSnobkXBJKqWKLlXa83Fyj9WktIfpIEzccDFiRpDEc6Tbz+1t7cl4ULiB/jqnd1cicLB6mPbc+95jebFUPhykNmdxN6EQE1h8=

BIN
AuthorizationSign/bin/Release/AuthorizationSign.exe


BIN
AuthorizationSign/bin/Release/AuthorizationSign.pdb


BIN
AuthorizationSign/bin/Release/BouncyCastle.Crypto.dll


BIN
AuthorizationSign/bin/Release/Cn.Ubingo.Security.Interop.dll


BIN
AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Core.dll


BIN
AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Data.dll


BIN
AuthorizationSign/bin/Release/Cn.Ubingo.Security.RSA.Key.dll


BIN
AuthorizationSign/obj/Debug/AuthorizationSign.Properties.Resources.resources


+ 0 - 0
AuthorizationSign/obj/Debug/AuthorizationSign.csproj.CopyComplete


+ 1 - 0
AuthorizationSign/obj/Debug/AuthorizationSign.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+d1927c7b9184c21602f32327347c36230622d1f2

+ 13 - 0
AuthorizationSign/obj/Debug/AuthorizationSign.csproj.FileListAbsolute.txt

@@ -0,0 +1,13 @@
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\AuthorizationSign.exe
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\AuthorizationSign.pdb
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\BouncyCastle.Crypto.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\Cn.Ubingo.Security.RSA.Core.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\Cn.Ubingo.Security.RSA.Data.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\Cn.Ubingo.Security.RSA.Key.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Debug\Cn.Ubingo.Security.Interop.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.Properties.Resources.resources
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.csproj.GenerateResource.cache
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.csproj.CoreCompileInputs.cache
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.csproj.CopyComplete
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.exe
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Debug\AuthorizationSign.pdb

BIN
AuthorizationSign/obj/Debug/AuthorizationSign.csproj.GenerateResource.cache


BIN
AuthorizationSign/obj/Debug/AuthorizationSign.exe


BIN
AuthorizationSign/obj/Debug/AuthorizationSign.pdb


BIN
AuthorizationSign/obj/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
AuthorizationSign/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
AuthorizationSign/obj/Release/AuthorizationSign.Properties.Resources.resources


+ 0 - 0
AuthorizationSign/obj/Release/AuthorizationSign.csproj.CopyComplete


+ 1 - 0
AuthorizationSign/obj/Release/AuthorizationSign.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+d1927c7b9184c21602f32327347c36230622d1f2

+ 14 - 0
AuthorizationSign/obj/Release/AuthorizationSign.csproj.FileListAbsolute.txt

@@ -0,0 +1,14 @@
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\AuthorizationSign.exe
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\AuthorizationSign.pdb
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\BouncyCastle.Crypto.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\Cn.Ubingo.Security.RSA.Core.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\Cn.Ubingo.Security.RSA.Data.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\Cn.Ubingo.Security.RSA.Key.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\bin\Release\Cn.Ubingo.Security.Interop.dll
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.csprojAssemblyReference.cache
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.Properties.Resources.resources
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.csproj.GenerateResource.cache
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.csproj.CoreCompileInputs.cache
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.csproj.CopyComplete
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.exe
+D:\dujj\src\Test_CanDelete\Demo_TestGit\C#\AuthorizationSign\AuthorizationSign\AuthorizationSign\obj\Release\AuthorizationSign.pdb

BIN
AuthorizationSign/obj/Release/AuthorizationSign.csproj.GenerateResource.cache


BIN
AuthorizationSign/obj/Release/AuthorizationSign.csprojAssemblyReference.cache


BIN
AuthorizationSign/obj/Release/AuthorizationSign.exe


BIN
AuthorizationSign/obj/Release/AuthorizationSign.pdb