Skip to content

Commit 4931819

Browse files
committed
1: Changed initialization of random generator
2: Changed documentation from Chinese to English
1 parent 14b51fb commit 4931819

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ To install NETCore.Encrypt, run the following command in the [Package Manager Co
1616

1717
## Package Manager
1818
```
19-
Install-Package NETCore.Encrypt -Version 2.0.9
19+
Install-Package NETCore.Encrypt -Version 2.0.9.1
2020
```
2121
## .NET CLI
2222
```
23-
dotnet add package NETCore.Encrypt --version 2.0.9
23+
dotnet add package NETCore.Encrypt --version 2.0.9.1
2424
```
2525

2626
## PackageReference
2727
```
28-
<PackageReference Include="NETCore.Encrypt" Version="2.0.9" />
28+
<PackageReference Include="NETCore.Encrypt" Version="2.0.9.1" />
2929
```
3030

3131

src/NETCore.Encrypt/EncryptProvider.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,13 +1196,13 @@ public static string HMACMD5(string srcString, string key)
11961196

11971197
#region SHA1
11981198
/// <summary>
1199-
/// SHA1加密
1199+
/// SHA1 Encryption
12001200
/// </summary>
12011201
/// <param name="str">The string to be encrypted</param>
12021202
/// <returns></returns>
12031203
public static string Sha1(string str)
12041204
{
1205-
Check.Argument.IsNotEmpty(str, "SHA1待加密字符");
1205+
Check.Argument.IsNotEmpty(str, nameof(str));
12061206

12071207
using (SHA1 sha1 = SHA1.Create())
12081208
{
@@ -1429,17 +1429,19 @@ public static string CreateValidationKey(int length)
14291429
}
14301430

14311431
/// <summary>
1432-
/// 使用加密服务提供程序实现加密生成随机数
1433-
///
1434-
/// 说明:
1435-
/// validationKey 的值可以是48到128个字符长,强烈建议使用可用的最长密钥
1436-
/// decryptionKey 的值可以是16到48字符长,建议使用48字符长
1437-
///
1438-
/// 使用方式:
1432+
/// <para>Use cryptographic service providers to implement encryption to generate random numbers</para>
1433+
/// <para>
1434+
/// Description:
1435+
/// validationKey The value can be 48 to 128 characters long.It is strongly recommended to use the longest key available
1436+
/// decryptionKey The value can be 16 to 48 characters long.It is recommended to use 48 characters long
1437+
/// </para>
1438+
/// <para>
1439+
/// How to use:
14391440
/// string decryptionKey = EncryptManager.CreateMachineKey(48);
14401441
/// string validationKey = EncryptManager.CreateMachineKey(128);
1442+
/// </para>
14411443
/// </summary>
1442-
/// <param name="length">长度</param>
1444+
/// <param name="length">Length</param>
14431445
/// <returns></returns>
14441446
private static string CreateMachineKey(int length)
14451447
{

src/NETCore.Encrypt/Extensions/Internal/RsaKeyExtensions.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
namespace NETCore.Encrypt.Extensions.Internal
1212
{
1313
/// <summary>
14-
/// RSA参数格式化扩展
14+
/// RSA Parameter formatting extension
1515
/// </summary>
1616
internal static class RSAKeyExtensions
1717
{
1818
#region JSON
1919
/// <summary>
20-
/// RSA导入key
20+
/// RSA import key
2121
/// </summary>
22-
/// <param name="rsa">RSA实例<see cref="RSA"/></param>
23-
/// <param name="jsonString">RSA的Key序列化JSON字符串</param>
22+
/// <param name="rsa">RSA instance<see cref="RSA"/></param>
23+
/// <param name="jsonString">RSA Key serialization JSON string</param>
2424
internal static void FromJsonString(this RSA rsa, string jsonString)
2525
{
2626
Check.Argument.IsNotEmpty(jsonString, nameof(jsonString));
@@ -47,10 +47,10 @@ internal static void FromJsonString(this RSA rsa, string jsonString)
4747
}
4848

4949
/// <summary>
50-
/// 获取RSA Key序列化Json
50+
/// Get the RSA Key serialized to Json
5151
/// </summary>
52-
/// <param name="rsa">RSA实例<see cref="RSA"/></param>
53-
/// <param name="includePrivateParameters">是否包含私钥</param>
52+
/// <param name="rsa">RSA instance<see cref="RSA"/></param>
53+
/// <param name="includePrivateParameters">Whether to include the private key</param>
5454
/// <returns></returns>
5555
internal static string ToJsonString(this RSA rsa, bool includePrivateParameters)
5656
{
@@ -75,10 +75,10 @@ internal static string ToJsonString(this RSA rsa, bool includePrivateParameters)
7575
#region XML
7676

7777
/// <summary>
78-
/// RSA导入key
78+
/// RSA import key
7979
/// </summary>
80-
/// <param name="rsa">RSA实例<see cref="RSA"/></param>
81-
/// <param name="jsonString">RSA的Key序列化XML字符串</param>
80+
/// <param name="rsa">RSA instance<see cref="RSA"/></param>
81+
/// <param name="xmlString">RSA Key serialization XML string</param>
8282
public static void FromLvccXmlString(this RSA rsa, string xmlString)
8383
{
8484
RSAParameters parameters = new RSAParameters();
@@ -112,10 +112,10 @@ public static void FromLvccXmlString(this RSA rsa, string xmlString)
112112
}
113113

114114
/// <summary>
115-
/// 获取RSA Key序列化XML
115+
/// Get the RSA Key as serialized XML
116116
/// </summary>
117-
/// <param name="rsa">RSA实例<see cref="RSA"/></param>
118-
/// <param name="includePrivateParameters">是否包含私钥</param>
117+
/// <param name="rsa">RSA instance<see cref="RSA"/></param>
118+
/// <param name="includePrivateParameters">Whether to include the private key</param>
119119
/// <returns></returns>
120120
public static string ToLvccXmlString(this RSA rsa, bool includePrivateParameters)
121121
{

src/NETCore.Encrypt/NETCore.Encrypt.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<PackageProjectUrl>https://github.com/myloveCc/NETCore.Encrypt</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/myloveCc/NETCore.Encrypt</RepositoryUrl>
1414
<RepositoryType>Github</RepositoryType>
15-
<AssemblyVersion>2.0.9.0</AssemblyVersion>
16-
<FileVersion>2.0.9.0</FileVersion>
17-
<Version>2.0.9</Version>
18-
<PackageReleaseNotes>1: Add OutofMaxlengthException for rsa encrypt.
19-
2: Add test about rsa OutofMaxlengthException.
15+
<AssemblyVersion>2.0.9.1</AssemblyVersion>
16+
<FileVersion>2.0.9.1</FileVersion>
17+
<Version>2.0.9.1</Version>
18+
<PackageReleaseNotes>1: Changed initialization of random generator
19+
2: Changed documentation from Chinese to English
2020
</PackageReleaseNotes>
2121
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2222
<IncludeSymbols>true</IncludeSymbols>

0 commit comments

Comments
 (0)