refactor(RSAFactory): Entfernen der Methode ReadRSADecryptorAsync.

This commit is contained in:
Developer 02
2024-12-07 02:01:06 +01:00
parent 50e2581727
commit 38bd23d012
4 changed files with 2 additions and 24 deletions

View File

@@ -40,26 +40,5 @@ namespace DigitalData.Core.Security.Cryptographer
return new string(pemChars);
}
public async Task<IRSADecryptor> ReadRSADecryptorAsync(string path, Version? version = null, CancellationToken cancellationToken = default)
{
var pem = await File.ReadAllTextAsync(path, cancellationToken);
(string Value, Version Version)? versionedPassword = null;
if (version is not null)
{
if (version != Secrets.Version)
throw new InvalidOperationException($"The provided version {version} does not match the expected version {Secrets.Version}.");
versionedPassword = (Secrets.PBE_PASSWORD, Secrets.Version);
}
return new RSADecryptor()
{
Pem = pem,
VersionedPassword = versionedPassword
};
}
}
}