Click or drag to resize

X509Certificate2ExtensionsDeletePrivateKey Method

Deletes private key material associated with a X.509 certificate from file system or hardware storage.

Namespace:  SysadminsLV.PKI.Utils.CLRExtensions
Assembly:  SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: (
public static bool DeletePrivateKey(
	this X509Certificate2 cert


Type: System.Security.Cryptography.X509CertificatesX509Certificate2
An instance of X.509 certificate.

Return Value

Type: Boolean
True if associated private key was found and successfully deleted, otherwise False.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type X509Certificate2. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also