From c42b11a35120c499f31d16a77a0d00db6a517d52 Mon Sep 17 00:00:00 2001 From: arontsang Date: Thu, 2 May 2024 15:14:09 +0800 Subject: [PATCH 1/4] Add KeySize --- src/LettuceEncrypt/LettuceEncryptOptions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LettuceEncrypt/LettuceEncryptOptions.cs b/src/LettuceEncrypt/LettuceEncryptOptions.cs index 614b3a02..eb088723 100644 --- a/src/LettuceEncrypt/LettuceEncryptOptions.cs +++ b/src/LettuceEncrypt/LettuceEncryptOptions.cs @@ -87,6 +87,11 @@ public bool UseStagingServer /// The asymmetric algorithm used for generating a private key for certificates: RS256, ES256, ES384, ES512 /// public KeyAlgorithm KeyAlgorithm { get; set; } = KeyAlgorithm.ES256; + + /// + /// The key size used for generating a private key for certificates + /// + public int? KeySize { get; set; } /// /// Specifies which kinds of ACME challenges LettuceEncrypt can use to verify domain ownership. From 2db716d55392cf70082db89c2e045c3b65936928 Mon Sep 17 00:00:00 2001 From: arontsang Date: Thu, 2 May 2024 15:19:21 +0800 Subject: [PATCH 2/4] Pass KeySize into NewKey --- src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs b/src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs index a0211420..a7543965 100644 --- a/src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs +++ b/src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs @@ -298,7 +298,8 @@ private async Task CompleteCertificateRequestAsync(IOrderConte { CommonName = commonName, }; - var privateKey = KeyFactory.NewKey((Certes.KeyAlgorithm)_options.Value.KeyAlgorithm); + var privateKeyAlgorithm = (Certes.KeyAlgorithm)_options.Value.KeyAlgorithm; + var privateKey = KeyFactory.NewKey(privateKeyAlgorithm, _options.Value.KeySize); var acmeCert = await _client.GetCertificateAsync(csrInfo, privateKey, order); _logger.LogAcmeAction("NewCertificate"); From 032ef2d6ce4e09f566933512b00326247d757f5a Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Sun, 19 May 2024 17:28:20 -0700 Subject: [PATCH 3/4] Bump version to 1.3.3 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index f488c945..0d1e45ec 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ - 1.3.2 + 1.3.3 beta true $([MSBuild]::ValueOrDefault($(BUILD_NUMBER), 0)) From c9d2417a37959e8a39fcbabdd2a996a8a266206a Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Sun, 19 May 2024 17:30:25 -0700 Subject: [PATCH 4/4] dotnet-format and update PublicAPI --- src/LettuceEncrypt/LettuceEncryptOptions.cs | 2 +- src/LettuceEncrypt/PublicAPI.Shipped.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LettuceEncrypt/LettuceEncryptOptions.cs b/src/LettuceEncrypt/LettuceEncryptOptions.cs index eb088723..cc9620ad 100644 --- a/src/LettuceEncrypt/LettuceEncryptOptions.cs +++ b/src/LettuceEncrypt/LettuceEncryptOptions.cs @@ -87,7 +87,7 @@ public bool UseStagingServer /// The asymmetric algorithm used for generating a private key for certificates: RS256, ES256, ES384, ES512 /// public KeyAlgorithm KeyAlgorithm { get; set; } = KeyAlgorithm.ES256; - + /// /// The key size used for generating a private key for certificates /// diff --git a/src/LettuceEncrypt/PublicAPI.Shipped.txt b/src/LettuceEncrypt/PublicAPI.Shipped.txt index b0817e10..6b4b2195 100644 --- a/src/LettuceEncrypt/PublicAPI.Shipped.txt +++ b/src/LettuceEncrypt/PublicAPI.Shipped.txt @@ -62,6 +62,8 @@ LettuceEncrypt.LettuceEncryptOptions.FallbackCertificate.get -> System.Security. LettuceEncrypt.LettuceEncryptOptions.FallbackCertificate.set -> void LettuceEncrypt.LettuceEncryptOptions.KeyAlgorithm.get -> LettuceEncrypt.KeyAlgorithm LettuceEncrypt.LettuceEncryptOptions.KeyAlgorithm.set -> void +LettuceEncrypt.LettuceEncryptOptions.KeySize.get -> int? +LettuceEncrypt.LettuceEncryptOptions.KeySize.set -> void LettuceEncrypt.LettuceEncryptOptions.LettuceEncryptOptions() -> void LettuceEncrypt.LettuceEncryptOptions.RenewalCheckPeriod.get -> System.TimeSpan? LettuceEncrypt.LettuceEncryptOptions.RenewalCheckPeriod.set -> void