Skip to content

Commit 8fe549d

Browse files
committed
Comments update
1 parent 0a60152 commit 8fe549d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Org.Security.Cryptography.X509Extensions/X509CertificateCache.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ public static X509Certificate2 TryGetCertificate(string x509Thumbprint, StoreNam
7979
// NOTE: Cache is ThreadStatic. It may not yet exist on this thread.
8080
CertificateCache = CertificateCache ?? new Dictionary<string, X509Certificate2>(StringComparer.OrdinalIgnoreCase);
8181

82-
// Unique key based on store location, name and thumbprint.
83-
// Optional cacheKeyPrefix if given use-case do not want to share the instance with other callers.
82+
// Unique key based on prefix, location, store and thumbprint.
8483
cacheKeyPrefix = cacheKeyPrefix ?? "default";
8584
var cacheKey = $"{cacheKeyPrefix}/{storeLocation}/{storeName}/{x509Thumbprint}";
8685

@@ -98,7 +97,7 @@ public static X509Certificate2 TryGetCertificate(string x509Thumbprint, StoreNam
9897
var certs = store
9998
.Certificates
10099
.Cast<X509Certificate2>()
101-
.Where(x => null != x && null != x.Thumbprint)
100+
.Where(x => null != x?.Thumbprint)
102101
.Where(x => x.Thumbprint.Equals(x509Thumbprint, StringComparison.OrdinalIgnoreCase))
103102
.ToArray();
104103

0 commit comments

Comments
 (0)