Skip to content

Commit

Permalink
Update to BouncyCastle.Cryptography v 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Pioli committed Oct 19, 2023
1 parent eea5496 commit 00b7115
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Certes/Pkcs/PfxBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private IList<X509Certificate> FindIssuers()
Cert = cert
});

var rootCerts = new HashSet(certificates.Where(c => c.IsRoot).Select(c => new TrustAnchor(c.Cert, null)));
var rootCerts = new HashSet<TrustAnchor>(certificates.Where(c => c.IsRoot).Select(c => new TrustAnchor(c.Cert, null)));
var intermediateCerts = certificates.Where(c => !c.IsRoot).Select(c => c.Cert).ToList();
intermediateCerts.Add(certificate);

Expand All @@ -125,10 +125,8 @@ private IList<X509Certificate> FindIssuers()
IsRevocationEnabled = false
};

builderParams.AddStore(
X509StoreFactory.Create(
"Certificate/Collection",
new X509CollectionStoreParameters(intermediateCerts)));
var x509CertStore = CollectionUtilities.CreateStore(intermediateCerts);
builderParams.AddStoreCert(x509CertStore);

var builder = new PkixCertPathBuilder();
var result = builder.Build(builderParams);
Expand Down

0 comments on commit 00b7115

Please sign in to comment.