@@ -218,7 +218,7 @@ public OpenIddictServerBuilder AddDevelopmentEncryptionCertificate(X500Distingui
218218 if ( ! certificates . Exists ( certificate => certificate . NotBefore < now . LocalDateTime && certificate . NotAfter > now . LocalDateTime ) )
219219 {
220220#if SUPPORTS_CERTIFICATE_GENERATION
221- using var algorithm = OpenIddictHelpers . CreateRsaKey ( size : 2048 ) ;
221+ using var algorithm = OpenIddictHelpers . CreateRsaKey ( size : 4096 ) ;
222222
223223 var request = new CertificateRequest ( subject , algorithm , HashAlgorithmName . SHA256 , RSASignaturePadding . Pkcs1 ) ;
224224 request . CertificateExtensions . Add ( new X509KeyUsageExtension ( X509KeyUsageFlags . KeyEncipherment , critical : true ) ) ;
@@ -310,7 +310,7 @@ public OpenIddictServerBuilder AddEphemeralEncryptionKey(string algorithm)
310310 SecurityAlgorithms . RsaOAEP or
311311 SecurityAlgorithms . RsaOaepKeyWrap
312312 => AddEncryptionCredentials ( new EncryptingCredentials (
313- new RsaSecurityKey ( OpenIddictHelpers . CreateRsaKey ( size : 2048 ) ) ,
313+ new RsaSecurityKey ( OpenIddictHelpers . CreateRsaKey ( size : 4096 ) ) ,
314314 algorithm , SecurityAlgorithms . Aes256CbcHmacSha512 ) ) ,
315315
316316 _ => throw new InvalidOperationException ( SR . GetResourceString ( SR . ID0058 ) )
@@ -593,11 +593,10 @@ public OpenIddictServerBuilder AddDevelopmentSigningCertificate(X500Distinguishe
593593 . Cast < X509Certificate2 > ( )
594594 . ToList ( ) ;
595595
596- if ( ! certificates . Exists ( certificate =>
597- certificate . NotBefore < now . LocalDateTime && certificate . NotAfter > now . LocalDateTime ) )
596+ if ( ! certificates . Exists ( certificate => certificate . NotBefore < now . LocalDateTime && certificate . NotAfter > now . LocalDateTime ) )
598597 {
599598#if SUPPORTS_CERTIFICATE_GENERATION
600- using var algorithm = OpenIddictHelpers . CreateRsaKey ( size : 2048 ) ;
599+ using var algorithm = OpenIddictHelpers . CreateRsaKey ( size : 4096 ) ;
601600
602601 var request = new CertificateRequest ( subject , algorithm , HashAlgorithmName . SHA256 , RSASignaturePadding . Pkcs1 ) ;
603602 request . CertificateExtensions . Add ( new X509KeyUsageExtension ( X509KeyUsageFlags . DigitalSignature , critical : true ) ) ;
@@ -693,7 +692,7 @@ SecurityAlgorithms.RsaSsaPssSha256Signature or
693692 SecurityAlgorithms . RsaSsaPssSha384Signature or
694693 SecurityAlgorithms . RsaSsaPssSha512Signature
695694 => AddSigningCredentials ( new SigningCredentials ( new RsaSecurityKey (
696- OpenIddictHelpers . CreateRsaKey ( size : 2048 ) ) , algorithm ) ) ,
695+ OpenIddictHelpers . CreateRsaKey ( size : 4096 ) ) , algorithm ) ) ,
697696
698697#if SUPPORTS_ECDSA
699698 SecurityAlgorithms . EcdsaSha256 or
0 commit comments