CertificateStoreDeleteCertificate Method
Removes the specified certificate from the store.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public bool DeleteCertificate(
	Certificate cert
)

Parameters

cert
Type: MailBee.SecurityCertificate
The certificate that should be removed from the store.

Return Value

Type: Boolean
true if the specified certificate was successfully removed; otherwise, false.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptioncert is a null reference (Nothing in Visual Basic).
MailBeeCertificateStoreWin32ExceptionWin32 returned an error on attempt to remove the certificates from the store and ThrowExceptions is true.
MailBeeCertificateExceptionCryptographicException occurred and ThrowExceptions is true.
Remarks
Starting from .NET Standard 2.0 edition, this method is just a wrapper around Remove(X509Certificate2) method.
Examples
This sample removes all certificates having the specified e-mail address from the store.
// 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);
}
See Also