c# - Delete SSL Certificate without prompting the user -
i have written lines of code delete certificates certificate store before installing new 1 if certificate exists, below:
x509store store = new x509store(storename.root, storelocation.currentuser); store.open(openflags.readwrite | openflags.includearchived); x509certificate2collection certs = store.certificates.find(x509findtype.findbysubjectname, "certname", false); if (certs.count > 0) { foreach (var cert in certs) { store.remove(cert); } }
but, each time certificate detected before deleted promts user press yes cert deleted. possible delete certs without asking user?
is possible delete certs without asking user?
the short answer no. certificate management (add/remove certs) in current user\trusted root cas
requires explicit user consent. behavior hardcoded in crypt32.dll
library.
Comments
Post a Comment