Skip to content

Commit

Permalink
Extend the selection of Root Certificates in x509Chain (#264)
Browse files Browse the repository at this point in the history
* init

Signed-off-by: Johannes Tuerk <[email protected]>

* trigger

Signed-off-by: Johannes Tuerk <[email protected]>

---------

Signed-off-by: Johannes Tuerk <[email protected]>
  • Loading branch information
JoTiTu authored Jan 31, 2025
1 parent 474107c commit e33bdd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WalletFramework.Core/X509/X509CertificateExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public static bool IsTrustChainValid(this List<X509Certificate> trustChain)
{
var leafCert = trustChain.First();

var subjects = trustChain.Select(cert => cert.SubjectDN);
var rootCerts = new HashSet(
trustChain
.Where(cert => cert.IsSelfSigned())
.Where(cert => cert.IsSelfSigned() || !subjects.Contains(cert.IssuerDN))
.Select(cert => new TrustAnchor(cert, null)));

var intermediateCerts = new HashSet(
Expand Down

0 comments on commit e33bdd4

Please sign in to comment.