36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System.Security.Cryptography;
|
|
|
|
namespace DigitalData.Core.Abstractions.Security
|
|
{
|
|
public interface ICryptFactory
|
|
{
|
|
int KeySizeInBits { get; init; }
|
|
|
|
string PbePassword { init; }
|
|
|
|
PbeEncryptionAlgorithm PbeEncryptionAlgorithm { get; init; }
|
|
|
|
HashAlgorithmName PbeHashAlgorithmName { get; init; }
|
|
|
|
int PbeIterationCount { get; init; }
|
|
|
|
PbeParameters PbeParameters { get; }
|
|
|
|
string EncryptedPrivateKeyPemLabel { get; init; }
|
|
|
|
Func<IRSADecryptor, string, string, string, string> RSADecryptorKeyFormatter { get; }
|
|
|
|
string CreateRSAPrivateKeyPem(int? keySizeInBits = null);
|
|
|
|
string CreateEncryptedPrivateKeyPem(
|
|
int? keySizeInBits = null,
|
|
string? password = null,
|
|
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
|
HashAlgorithmName? hashAlgorithmName = null,
|
|
int? iterationCount = null);
|
|
|
|
IRSADecryptor this[string key] { get; }
|
|
|
|
bool TryGetRSADecryptor(string key, out IRSADecryptor? decryptor);
|
|
}
|
|
} |