Skip to content

Commit c50d51e

Browse files
committed
feat: use byte[] to hold encrypted data
1 parent f2d1d7d commit c50d51e

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
namespace SafeCrypt.RsaEncryption.Models
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace SafeCrypt.RsaEncryption.Models
24
{
3-
internal class RsaEncryptionParameters : IEncryptionData
5+
public sealed class RsaEncryptionParameters : IEncryptionData
46
{
57
/// <summary>
68
/// Gets or sets the public key for RSA encryption.
79
/// </summary>
8-
public string PublicKey { get; set; }
10+
[Required]
11+
public string PublicKey { get; set; }
12+
13+
/// <summary>
14+
/// Gets or sets the data to be encrypted using RSA.
15+
/// </summary>
16+
[Required]
17+
public string DataToEncrypt { get; set; }
18+
}
919

20+
public sealed class RsaDecryptionParameters
21+
{
1022
/// <summary>
11-
/// Gets or sets the private key for RSA encryption.
23+
/// Gets or sets the public key for RSA encryption.
1224
/// </summary>
25+
[Required]
1326
public string PrivateKey { get; set; }
1427

1528
/// <summary>
1629
/// Gets or sets the data to be encrypted using RSA.
1730
/// </summary>
18-
public string DataToEncrypt { get; set; }
31+
[Required]
32+
public byte[] DataToDecrypt { get; set; }
1933
}
2034
}

0 commit comments

Comments
 (0)