Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 7ca3fcc

Browse files
feat: add parameter to adjust KeySize (#295)
--------- Co-authored-by: Nate McMaster <nate.mcmaster@gmail.com>
1 parent 49e2c62 commit 7ca3fcc

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</PropertyGroup>
3535

3636
<PropertyGroup>
37-
<VersionPrefix>1.3.2</VersionPrefix>
37+
<VersionPrefix>1.3.3</VersionPrefix>
3838
<VersionSuffix>beta</VersionSuffix>
3939
<IncludePreReleaseLabelInPackageVersion Condition="'$(IS_STABLE_BUILD)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
4040
<BuildNumber Condition=" '$(BuildNumber)' == '' ">$([MSBuild]::ValueOrDefault($(BUILD_NUMBER), 0))</BuildNumber>

src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ private async Task<X509Certificate2> CompleteCertificateRequestAsync(IOrderConte
298298
{
299299
CommonName = commonName,
300300
};
301-
var privateKey = KeyFactory.NewKey((Certes.KeyAlgorithm)_options.Value.KeyAlgorithm);
301+
var privateKeyAlgorithm = (Certes.KeyAlgorithm)_options.Value.KeyAlgorithm;
302+
var privateKey = KeyFactory.NewKey(privateKeyAlgorithm, _options.Value.KeySize);
302303
var acmeCert = await _client.GetCertificateAsync(csrInfo, privateKey, order);
303304

304305
_logger.LogAcmeAction("NewCertificate");

src/LettuceEncrypt/LettuceEncryptOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public bool UseStagingServer
8888
/// </summary>
8989
public KeyAlgorithm KeyAlgorithm { get; set; } = KeyAlgorithm.ES256;
9090

91+
/// <summary>
92+
/// The key size used for generating a private key for certificates
93+
/// </summary>
94+
public int? KeySize { get; set; }
95+
9196
/// <summary>
9297
/// Specifies which kinds of ACME challenges LettuceEncrypt can use to verify domain ownership.
9398
/// Defaults to <see cref="ChallengeType.Any"/>.

src/LettuceEncrypt/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ LettuceEncrypt.LettuceEncryptOptions.FallbackCertificate.get -> System.Security.
6262
LettuceEncrypt.LettuceEncryptOptions.FallbackCertificate.set -> void
6363
LettuceEncrypt.LettuceEncryptOptions.KeyAlgorithm.get -> LettuceEncrypt.KeyAlgorithm
6464
LettuceEncrypt.LettuceEncryptOptions.KeyAlgorithm.set -> void
65+
LettuceEncrypt.LettuceEncryptOptions.KeySize.get -> int?
66+
LettuceEncrypt.LettuceEncryptOptions.KeySize.set -> void
6567
LettuceEncrypt.LettuceEncryptOptions.LettuceEncryptOptions() -> void
6668
LettuceEncrypt.LettuceEncryptOptions.RenewalCheckPeriod.get -> System.TimeSpan?
6769
LettuceEncrypt.LettuceEncryptOptions.RenewalCheckPeriod.set -> void

0 commit comments

Comments
 (0)