Skip to content

Commit

Permalink
feat: add parameter to adjust KeySize (#295)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Nate McMaster <nate.mcmaster@gmail.com>
  • Loading branch information
arontsang and natemcmaster committed May 20, 2024
1 parent 49e2c62 commit 7ca3fcc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.3.2</VersionPrefix>
<VersionPrefix>1.3.3</VersionPrefix>
<VersionSuffix>beta</VersionSuffix>
<IncludePreReleaseLabelInPackageVersion Condition="'$(IS_STABLE_BUILD)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
<BuildNumber Condition=" '$(BuildNumber)' == '' ">$([MSBuild]::ValueOrDefault($(BUILD_NUMBER), 0))</BuildNumber>
Expand Down
3 changes: 2 additions & 1 deletion src/LettuceEncrypt/Internal/AcmeCertificateFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ public async Task<X509Certificate2> CreateCertificateAsync(CancellationToken can
{
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");
Expand Down
5 changes: 5 additions & 0 deletions src/LettuceEncrypt/LettuceEncryptOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public bool UseStagingServer
/// </summary>
public KeyAlgorithm KeyAlgorithm { get; set; } = KeyAlgorithm.ES256;

/// <summary>
/// The key size used for generating a private key for certificates
/// </summary>
public int? KeySize { get; set; }

/// <summary>
/// Specifies which kinds of ACME challenges LettuceEncrypt can use to verify domain ownership.
/// Defaults to <see cref="ChallengeType.Any"/>.
Expand Down
2 changes: 2 additions & 0 deletions src/LettuceEncrypt/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ca3fcc

Please sign in to comment.