Windows – Mark private key as not exportable

certificateiiswindows

Is there any way to mark a private key as NOT EXPORTABLE if the key has already been imported as EXPORTABLE?

A bit more insight:

A certificate containing a private key has already been imported with the option to allow the private key to be exported. However, we'd like to step up the security a bit and mark the key as not exportable. Since the certificate is a wildcard certificate and is bound to a lot of websites, we'd like to avoid deleting the certificate and reimporting it.

The environment is Windows Server 2012 R2.

Best Answer

To my knowledge, the only way to mark a private key as unexportable in your situation is to reimport the certificate. Once it's already imported, you can't modify the boolean variable which sets that option.

The variable which is looked up and defines a private key as exportable or not is:

PrivateKeyExportable
Optional
System.Boolean
The PrivateKeyExportable parameter specifies whether the certificate has an exportable private key, and controls whether you can export the certificate from this server. Valid values are:
$true   The private key is exportable, so you can export the certificate from this server.
$false   The private key isn't exportable, so you can't export the certificate from this server. This is the default value.