File tree Expand file tree Collapse file tree
src/SafeCrypt.Lib/Encryption/RsaEncryption Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,20 +41,23 @@ public static async Task<EncryptionResult> EncryptAsync(RsaEncryptionParameters
4141 }
4242
4343 // Convert the encrypted data to a hexadecimal string
44+ //result.EncryptedData = data.EncryptedData;
45+ //result.EncryptedData = Convert.ToBase64String(data.EncryptedData);
4446 //result.EncryptedData = BitConverter.ToString(data.EncryptedData);
45- result . EncryptedData = Encoding . UTF8 . GetString ( data . EncryptedData ) ; //Encoding.UTF8.GetString(decryptedData)
47+ //result.EncryptedData = Encoding.UTF8.GetString(data.EncryptedData); //Encoding.UTF8.GetString(decryptedData)
48+ result . EncryptedData = data . EncryptedData ; //Encoding.UTF8.GetString(decryptedData)
4649 return result ;
4750 }
4851
4952 public static async Task < DecryptionResult > DecryptAsync ( RsaDecryptionParameters model )
5053 {
5154 var result = new DecryptionResult ( ) ;
5255
53- if ( string . IsNullOrWhiteSpace ( model . DataToDecrypt ) )
54- {
55- result . Errors . Add ( $ "Data cannot be null { nameof ( model . DataToDecrypt ) } ") ;
56- return result ;
57- }
56+ // if (string.IsNullOrWhiteSpace(model.DataToDecrypt))
57+ // {
58+ // result.Errors.Add($"Data cannot be null {nameof(model.DataToDecrypt)}");
59+ // return result;
60+ // }
5861
5962 if ( string . IsNullOrWhiteSpace ( model . PrivateKey ) )
6063 {
@@ -71,8 +74,7 @@ public static async Task<DecryptionResult> DecryptAsync(RsaDecryptionParameters
7174 result . Errors . AddRange ( data . Errors ) ;
7275 return result ;
7376 }
74-
75- // convert the encrypted data to a hexadecimal string
77+
7678 result . DecryptedData = Encoding . UTF8 . GetString ( data . DecryptedData ) ;
7779 return result ;
7880 }
You can’t perform that action at this time.
0 commit comments