Removes the specified certificate from the store.
true if the specified certificate was successfully removed; otherwise, false.
| Exception Type | Condition |
|---|---|
| MailBeeInvalidArgumentException | cert is a null reference (Nothing in Visual Basic). |
| MailBeeCertificateStoreWin32Exception | Win32 returned an error on attempt to remove the certificates from the store and ThrowExceptions is true. |
This sample removes all certificates having the specified e-mail address from the store.
[C#] // To use the code below, import MailBee namespace at the top of your code using MailBee.Security; // The actual code (put it into a method of your class). CertificateStore store = new CertificateStore("TestStore", CertStoreType.System, null); CertificateCollection coll = store.FindCertificates("user@domain.com", CertificateFields.EmailAddress); foreach (Certificate cert in coll) { store.DeleteCertificate(cert); }
[Visual Basic] ' To use the code below, import MailBee namespace at the top of your code Imports MailBee.Security ' The actual code (put it into a method of your class). Dim store As CertificateStore = New CertificateStore("TestStore", CertStoreType.System, Nothing) Dim coll As CertificateCollection = store.FindCertificates("user@domain.com", CertificateFields.EmailAddress) For Each cert As Certificate In coll store.DeleteCertificate(cert) Next
CertificateStore Class | MailBee.Security Namespace