diff --git a/src/Core/Abstractions/ICryptoFunctionService.cs b/src/Core/Abstractions/ICryptoFunctionService.cs index 0aaa290cc..157c9efd7 100644 --- a/src/Core/Abstractions/ICryptoFunctionService.cs +++ b/src/Core/Abstractions/ICryptoFunctionService.cs @@ -1,10 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Text; +using Bit.Core.Enums; +using System; +using System.Threading.Tasks; namespace Bit.Core.Abstractions { public interface ICryptoFunctionService { + Task Pbkdf2Async(string password, string salt, CryptoHashAlgorithm algorithm, int iterations); + Task Pbkdf2Async(byte[] password, string salt, CryptoHashAlgorithm algorithm, int iterations); + Task Pbkdf2Async(string password, byte[] salt, CryptoHashAlgorithm algorithm, int iterations); + Task Pbkdf2Async(byte[] password, byte[] salt, CryptoHashAlgorithm algorithm, int iterations); + Task HashAsync(string value, CryptoHashAlgorithm algorithm); + Task HashAsync(byte[] value, CryptoHashAlgorithm algorithm); + Task HmacAsync(byte[] value, byte[] key, CryptoHashAlgorithm algorithm); + Task CompareAsync(byte[] a, byte[] b); + Task AesEncryptAsync(byte[] data, byte[] iv, byte[] key); + Task AesDecryptAsync(byte[] data, byte[] iv, byte[] key); + Task RsaEncryptAsync(byte[] data, byte[] publicKey, CryptoHashAlgorithm algorithm); + Task RsaDecryptAsync(byte[] data, byte[] privateKey, CryptoHashAlgorithm algorithm); + Task RsaExtractPublicKeyAsync(byte[] privateKey); + Task> RsaGenerateKeyPairAsync(int length); + Task RandomBytesAsync(int length); } }