Skip to content

Commit 0a60152

Browse files
authored
Comments update.
1 parent be41b82 commit 0a60152

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
//
66
// It takes approx 5 miiliSec to lookup and obtain the certificate from local certificate store,
77
// unless the Store itself is handled as singleton and never closed during process lifetime.
8-
//
98
// X509CertificateCache can be used to cache and re-use the certs.
10-
// This is NOT a secrity issue, as the process has access to the certificate in the store.
11-
// If given process do not have access to the certificate, it won't reach the cache in the first place.
129
//
1310
// Using the X509 certificate instance:
1411
// Use the cache ONLY IF you absolutely know how you are using the X509Certificate2 instance.
@@ -21,22 +18,20 @@
2118
//
2219
// Is this thread-safe?
2320
// The X509CertificateCache maintains per-thread-cache.
24-
// Each thread has its own instance of the cache and the cached versions of the X509 certificate.
21+
// Each thread has its own instance of the cache and corresponding cached versions of the X509 certificate.
2522
// The cache is as thread-safe as the X509Certificate instance itself.
2623
// The cache can't prevent you from passing the certificate instances in an async call, crossing thread boundary.
2724
// If you are concerned about thread safety, do not pass the certifcates across async-call boundaries.
28-
// For threadsafety of X509Certificate2 related operations, refer Microsoft documentation.
25+
// For thread safety of X509Certificate2 related operations, refer Microsoft documentation.
2926
//
3027
// How about server-restart on certificate changes?
3128
// The ONLY option supported by the cache is lookup by thumbprint.
3229
// The cache doesn't support lookup by other properties that may change, such as SubjectName.
3330
// The thumbprint is a digital fingerprint for specific certificate instance.
34-
// Also, the certificates are cached based on StoreName and StoreLocation to avoid ambuguity.
35-
// Certs identified by thumbprint can't change for life-time, without change to the thumbprint itself.
36-
// In general, you should not have to to re-start the server after adding/updating certificate.
31+
// In addition, the certificates are cached based on StoreName and StoreLocation to avoid ambiguity.
32+
// Certs identified by thumbprint can be treated immutable, as any change in certificate info would result in a new thumbprint.
33+
// In general, you should not have to re-start the server after adding/updating certificate.
3734
// DELETING a certificate might require a restart if the certificate is already cached.
38-
// Stop using the old thumbprint to avoid restart.
39-
// Another case is, if the permission to a certificate was revoked to the process, after it was already cached.
4035
//
4136
// As with any other library, read-and-understand the code before using.
4237
//

0 commit comments

Comments
 (0)