c# - filtering client certificates like browser -


i have smart card reader. when attempt visit website accepts client certificates, browser gives me list of 2 or 3 client certificates.

all of these certificate options closely related cards have been used machine.

when try access these options via x509store class in .net, 256 options. many user sort through!

x509store store = new x509store("my", storelocation.currentuser); store.open(openflags.openexistingonly | openflags.readwrite); 

most of certificates user should not pick start asterix, can filter out 80% or so. example:

*.amazonaws.com *.slashdotmedia.com *.msedge.net

my question is: how can narrow options down manageable level browser (chrome) .net ?

first of all: open certificate store read-only:

store.open(openflags.readonly); 

next, have filter application policy = client authentication:

var certs = store.certificates.find(x509findtype.findbyapplicationpolicy, "1.3.6.1.5.5.7.3.2", true); 

certs variable store valid certificates (trusted, non-revoked, time-valid, etc.) , suitable client authentication.

when done, close store:

store.close(); 

Comments