feat(RSAFactory): Optionale Verschlüsselungseingabe in CreatePrivateKeyPem Methode hinzugefügt.
- Falsch als Standard eingestellt.
This commit is contained in:
parent
7da93c6719
commit
eced1a5afc
@ -4,16 +4,16 @@ namespace DigitalData.Core.Abstractions.Security
|
|||||||
{
|
{
|
||||||
public interface IRSAFactory
|
public interface IRSAFactory
|
||||||
{
|
{
|
||||||
string CreatePrivateKeyPem(int? keySizeInBits = null);
|
string CreatePrivateKeyPem(int? keySizeInBits = null, bool encrypt = false);
|
||||||
|
|
||||||
public string CreateEncryptedPrivateKeyPem(
|
string CreateEncryptedPrivateKeyPem(
|
||||||
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
||||||
HashAlgorithmName? hashAlgorithmName = null,
|
HashAlgorithmName? hashAlgorithmName = null,
|
||||||
int? iterationCount = null,
|
int? iterationCount = null,
|
||||||
int? keySizeInBits = null,
|
int? keySizeInBits = null,
|
||||||
string? password = null);
|
string? password = null);
|
||||||
|
|
||||||
public string CreateEncryptedPrivateKeyPem(
|
string CreateEncryptedPrivateKeyPem(
|
||||||
PbeParameters pbeParameters,
|
PbeParameters pbeParameters,
|
||||||
int? keySizeInBits = null,
|
int? keySizeInBits = null,
|
||||||
string? password = null);
|
string? password = null);
|
||||||
|
|||||||
@ -11,8 +11,9 @@ namespace DigitalData.Core.Security.Cryptographer
|
|||||||
|
|
||||||
public RSAFactory(IOptions<TRSAFactoryParams> options) => _params = options.Value;
|
public RSAFactory(IOptions<TRSAFactoryParams> options) => _params = options.Value;
|
||||||
|
|
||||||
public string CreatePrivateKeyPem(int? keySizeInBits = null)
|
public string CreatePrivateKeyPem(int? keySizeInBits = null, bool encrypt = false) => encrypt
|
||||||
=> RSA.Create(keySizeInBits ?? _params.KeySizeInBits).ExportRSAPrivateKeyPem();
|
? CreateEncryptedPrivateKeyPem(keySizeInBits: keySizeInBits)
|
||||||
|
: RSA.Create(keySizeInBits ?? _params.KeySizeInBits).ExportRSAPrivateKeyPem();
|
||||||
|
|
||||||
public string CreateEncryptedPrivateKeyPem(
|
public string CreateEncryptedPrivateKeyPem(
|
||||||
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user