Skip to content

Commit 7fa16f6

Browse files
committed
feat: add and use EncryptionData
1 parent ea89d15 commit 7fa16f6

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

src/Encryption/AesEncryption/Encrypting.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public byte[] Encrypt(StringEncryptionParameters param)
6161
/// <exception cref="ArgumentNullException">
6262
/// Thrown if the input data or secret key is null.
6363
/// </exception>
64-
public AesEncrypted Encrypt(string data, string secretKey)
64+
public EncryptionData Encrypt(string data, string secretKey)
6565
{
6666
NullChecks(data, secretKey);
6767

@@ -81,7 +81,7 @@ public AesEncrypted Encrypt(string data, string secretKey)
8181
//var response = EncryptAES(aesData, aesKey, aesIv);
8282
var response = EncryptAES(byteEncryptionParameters);
8383

84-
var responseData = new AesEncrypted
84+
var responseData = new EncryptionData
8585
{
8686
Data = response,
8787
Iv = aesIv

src/Encryption/AesEncryption/Models/AesEncryptionData.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace SafeCrypt.src.Encryption.AesEncryption.Models
6+
{
7+
/// <summary>
8+
/// Represents the data and initialization vector (IV) used in encryption.
9+
/// </summary>
10+
public class EncryptionData
11+
{
12+
/// <summary>
13+
/// Gets or sets the data to be encrypted.
14+
/// </summary>
15+
public byte[] Data { get; set; }
16+
17+
/// <summary>
18+
/// Gets or sets the initialization vector (IV) used for encryption.
19+
/// </summary>
20+
public byte[] Iv { get; set; }
21+
}
22+
}

0 commit comments

Comments
 (0)