Skip to content

Commit 0185cef

Browse files
committed
add keySize and padding property.
1 parent eda0145 commit 0185cef

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/NETCore.Encrypt/Exception/OutofMaxlengthException.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Security.Cryptography;
34
using System.Text;
45

56
namespace NETCore.Encrypt
67
{
78
/// <summary>
89
/// The encrypt string out of max length exception
910
/// </summary>
10-
public class OutofMaxlengthException:Exception
11+
public class OutofMaxlengthException : Exception
1112
{
1213
/// <summary>
1314
/// The max length of ecnrypt data
@@ -18,21 +19,34 @@ public class OutofMaxlengthException:Exception
1819
/// Error message
1920
/// </summary>
2021

21-
public string ErrorMessage { get; set; }
22+
public string ErrorMessage { get; private set; }
23+
24+
/// <summary>
25+
/// Rsa key size
26+
/// </summary>
27+
public int KeySize { get; private set; }
28+
29+
/// <summary>
30+
/// Rsa padding
31+
/// </summary>
32+
public RSAEncryptionPadding RSAEncryptionPadding { get; private set; }
33+
2234
/// <summary>
2335
/// Ctor
2436
/// </summary>
2537
/// <param name="maxLength"></param>
26-
public OutofMaxlengthException(int maxLength)
38+
public OutofMaxlengthException(int maxLength, int keySize, RSAEncryptionPadding rsaEncryptionPadding)
2739
{
2840
MaxLength = maxLength;
41+
KeySize = keySize;
42+
RSAEncryptionPadding = rsaEncryptionPadding;
2943
}
3044

3145
/// <summary>
3246
/// Ctor
3347
/// </summary>
3448
/// <param name="maxLength"></param>
35-
public OutofMaxlengthException(int maxLength, string message) : this(maxLength)
49+
public OutofMaxlengthException(string message, int maxLength, int keySize, RSAEncryptionPadding rsaEncryptionPadding) : this(maxLength,keySize, rsaEncryptionPadding)
3650
{
3751
ErrorMessage = message;
3852
}

0 commit comments

Comments
 (0)