---
title: Private Key Health Monitoring - Windows Server Certificates
description: Monitor certificate private key health including presence detection, exportability security risks, and cryptographic strength validation for RSA and ECDSA keys.
---

# <i class="fal fa-key" aria-hidden="true"></i> Private Key Health Monitoring

:6.4.0.0: Monitor certificate **Private Key Health** to detect security risks and accessibility issues including missing keys, exportable keys, and insufficient key lengths.

## <i class="fal fa-shield-check" aria-hidden="true"></i> Overview

Private key health monitoring validates that certificates have secure, accessible private keys with appropriate cryptographic strength. This monitoring detects three critical security issues:

* **Missing Private Keys**: Certificates without accessible private keys (rendering them unusable)  
* **Exportable Private Keys**: Keys that can be exported pose security risks if compromised  
* **Weak Key Lengths**: Keys below minimum recommended lengths (RSA < 2048 bits, ECDSA < 256 bits)  

## <i class="fal fa-traffic-light" aria-hidden="true"></i> State Evaluation

Certificates are evaluated based on private key health with the following states:

|**Condition**|**State**|**Description**|  
|---|---|---|  
|Private key present, non-exportable, sufficient length|✅ **OK**|Secure configuration|  
|Private key exportable OR key length below minimum|⚠️ **WARNING**|Security risk detected|  
|Certificate in Personal store lacks private key|❌ **ERROR**|Certificate unusable|  
|Certificate not in Personal store, no private key|⚠️ **WARNING**|Expected for CA/Root certificates|  

### Private Key Presence Detection

#### What It Checks

* Does the certificate have an associated private key?
* Is the private key accessible to the monitoring agent?
* Is the certificate in a store where private keys are expected (Personal/My store)?

#### Why It Matters

Certificates in the **Personal (My)** store are typically used for:

* SSL/TLS server authentication ([IIS][], web services)
* Client authentication (mTLS, VPN)
* Code signing and email encryption
* Service-to-service authentication

Without a private key, these certificates **cannot function** for their intended purpose.

#### Example Scenarios

```text
✅ OK: Web server certificate with private key
   Store: LocalMachine\My
   Has Private Key: Yes
   Exportable: No
   Key Length: 2048 bits (RSA)

❌ ERROR: Certificate without private key in Personal store
   Store: LocalMachine\My
   Has Private Key: No
   Issue: Cannot be used for SSL/TLS authentication

⚠️ WARNING: Root CA certificate without private key
   Store: LocalMachine\Root
   Has Private Key: No
   Expected: Root certificates don't require private keys
```

### Exportability Security

#### What It Checks

* Is the private key marked as exportable?
* Can the key material be extracted from the certificate store?

#### Why It Matters

**Exportable private keys** pose significant security risks:

* **Key Theft**: Attackers with system access can export and steal private keys
* **Unauthorized Duplication**: Keys can be copied to other systems without authorization
* **Compliance Violations**: Many security standards prohibit exportable private keys
* **Long-Term Risk**: Even if key is never exported, the *possibility* creates persistent risk

**Security Best Practice**: Private keys should be **non-exportable** and hardware-protected when possible (HSM, TPM).

#### Example Scenarios

```text
⚠️ WARNING: Exportable private key detected
   Certificate: www.example.com
   Private Key: Exportable
   Risk: Key can be stolen if system is compromised
   Recommendation: Re-issue certificate with non-exportable key

✅ OK: Non-exportable private key
   Certificate: www.example.com
   Private Key: Non-Exportable
   Security: Key cannot be extracted from certificate store
```

### Key Length Validation

#### What It Checks

* RSA key length ≥ 2048 bits (default minimum)
* ECDSA key length ≥ 256 bits (default minimum)
* Configurable thresholds via `MinimumPrivateKeyLength` setting

#### Why It Matters

**Weak key lengths** are vulnerable to:

* **Brute Force Attacks**: Modern computing power can break keys < 2048 bits
* **Quantum Computing Threat**: Future quantum computers may break RSA < 4096 bits
* **Compliance Requirements**: PCI-DSS, NIST, and other standards mandate minimum key lengths

#### Recommended Key Lengths

|**Algorithm**|**Minimum**|**Recommended**|**High Security**|  
|---|---|---|---|  
|**RSA**|2048 bits|2048 bits|4096 bits|  
|**ECDSA**|256 bits|256 bits|384 bits|  
|**DSA**|2048 bits|3072 bits|⚠️ Deprecated|  

#### Example Scenarios

```text
⚠️ WARNING: Weak RSA key length
   Certificate: legacy.example.com
   Algorithm: RSA
   Key Length: 1024 bits
   Risk: Vulnerable to brute force attacks
   Recommendation: Re-issue with 2048+ bit key

✅ OK: Strong RSA key
   Certificate: www.example.com
   Algorithm: RSA
   Key Length: 2048 bits
   Security: Meets current standards

✅ OK: Strong ECDSA key
   Certificate: api.example.com
   Algorithm: ECDSA (P-256)
   Key Length: 256 bits
   Security: Equivalent to RSA 3072 bits
```

## <i class="fal fa-display" aria-hidden="true"></i> Certificate Details Display

Private key information is displayed in the certificate Details view:

### Private Key Information Section

```text
Private Key Information
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Has Private Key: ✅ Yes
Exportable: ❌ No (Secure)
Key Algorithm: RSA
Key Length: 2048 bits
Key Container: {GUID}
Key Provider: Microsoft Software Key Storage Provider

✅ Private key is secure and accessible
```

### Warning Examples

```text
⚠️ WARNING: Exportable Private Key
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Has Private Key: ✅ Yes
Exportable: ⚠️ Yes (Security Risk)
Key Algorithm: RSA
Key Length: 2048 bits

⚠️ Security Risk: This private key can be exported
Recommendation: Re-issue certificate with non-exportable key
```

```text
⚠️ WARNING: Weak Key Length
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Has Private Key: ✅ Yes
Exportable: ❌ No
Key Algorithm: RSA
Key Length: 1024 bits (Below minimum: 2048 bits)

⚠️ Security Risk: Key length does not meet current standards
Recommendation: Re-issue certificate with 2048+ bit key
```

```text
❌ ERROR: Missing Private Key
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Has Private Key: ❌ No
Store Location: LocalMachine\My (Personal)

❌ Critical: Certificate cannot be used without private key
This certificate was likely imported without its private key or
the private key was deleted. Re-import the certificate with its
private key or obtain a new certificate.
```

![Certificate Details with Private Key Information][10]  
*Certificate details page showing Private Key Information section with health monitoring data.*

## <i class="fal fa-cog" aria-hidden="true"></i> Configuration

Configure private key health monitoring via <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> web interface or agent configuration file.

### Configuration Settings

|**Setting**|**Default**|**Purpose**|  
|---|---|---|  
|<i class="fal fa-toggle-on" aria-hidden="true"></i> **Monitor Private Key Health**|✅ Enabled|Enable/disable private key monitoring|  
|<i class="fal fa-square-check" aria-hidden="true"></i> **Alert on Missing Private Key**|✅ Enabled|ERROR when Personal store cert lacks private key|  
|<i class="fal fa-square-check" aria-hidden="true"></i> **Alert on Exportable Private Key**|✅ Enabled|WARNING when private key is exportable|  
|<i class="fal fa-arrow-down-wide-short" aria-hidden="true"></i> **Minimum Private Key Length**|2048 bits|WARNING if RSA key < this length|  

For detailed configuration options, see [Certificate Configuration - Private Key Health][Certificate Configuration].

## <i class="fal fa-vial" aria-hidden="true"></i> Testing Private Key Monitoring

Create test certificates to validate private key health monitoring:

### Test Scenario 1: Certificate with Secure Private Key (OK)

```powershell
# Create certificate with non-exportable private key (secure)
$secureCert = New-SelfSignedCertificate `
    -Subject "CN=Secure-Test" `
    -CertStoreLocation "Cert:\LocalMachine\My" `
    -KeyExportPolicy NonExportable `
    -KeyLength 2048
# Expected: OK state - non-exportable, 2048-bit key
```

### Test Scenario 2: Certificate with Exportable Private Key (WARNING)

```powershell
# Create certificate with exportable private key (security risk)
$exportableCert = New-SelfSignedCertificate `
    -Subject "CN=Exportable-Test" `
    -CertStoreLocation "Cert:\LocalMachine\My" `
    -KeyExportPolicy Exportable `
    -KeyLength 2048
# Expected: WARNING state - exportable private key detected
```

### Test Scenario 3: Certificate with Weak Key Length (WARNING)

```powershell
# Create certificate with 1024-bit key (weak)
$weakKeyCert = New-SelfSignedCertificate `
    -Subject "CN=WeakKey-Test" `
    -CertStoreLocation "Cert:\LocalMachine\My" `
    -KeyLength 1024
# Expected: WARNING state - key length below 2048 bits
```

### Test Scenario 4: Certificate Without Private Key (ERROR)

```powershell
# Export certificate without private key
$cert = Get-ChildItem "Cert:\LocalMachine\My"|Select-Object -First 1
Export-Certificate -Cert $cert -FilePath "cert-no-key.cer" -Type CERT

# Import certificate without private key
Import-Certificate -FilePath "cert-no-key.cer" -CertStoreLocation "Cert:\LocalMachine\My"
# Expected: ERROR state - certificate in Personal store without private key
```

### Test Scenario 5: ECDSA Certificate with Strong Key (OK)

```powershell
# Create ECDSA certificate with P-256 curve (256-bit equivalent)
$ecdsaCert = New-SelfSignedCertificate `
    -Subject "CN=ECDSA-Test" `
    -CertStoreLocation "Cert:\LocalMachine\My" `
    -KeyAlgorithm ECDSA_nistP256 `
    -KeyExportPolicy NonExportable
# Expected: OK state - ECDSA 256-bit key, non-exportable
```

For comprehensive testing scripts and additional scenarios, see [FAQ: Private Key Health][].

## <i class="fal fa-shield-check" aria-hidden="true"></i> Security Best Practices

1. **Never Use Exportable Keys in Production**: Always set `-KeyExportPolicy NonExportable` when creating certificates
2. **Minimum Key Lengths**: Use 2048+ bits for RSA, 256+ bits for ECDSA
3. **Hardware Security Modules (HSM)**: Store private keys in HSMs when possible for maximum security
4. **Regular Key Rotation**: Replace certificates with weak keys during next renewal cycle
5. **Monitor Continuously**: Enable private key health monitoring on all certificate-bearing servers
6. **Audit Exportable Keys**: Identify and replace any exportable private keys in production environments
7. **Document Exceptions**: If exportable keys are required (backup scenarios), document the business justification

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-asterisk" aria-hidden="true"></i> [Weak Cryptography Detection][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-home" aria-hidden="true"></i> [Certificate Monitoring Overview][Certificate Monitoring]  
* <i class="fal fa-cog" aria-hidden="true"></i> [Certificate Configuration][]  
* <i class="fal fa-wrench" aria-hidden="true"></i> [Certificate Remote Actions][]  
* <i class="fal fa-question-circle" aria-hidden="true"></i> [FAQ: Private Key Health][]  

[10]:https://docs.nodinite.com/media/Documentation%20Pictures/MonitorAgent/WindowsServer/Certificates/CertificateWithPrivateKey.png

[Certificate Configuration]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/configuration/
[Certificate Monitoring]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/monitoring/
[Certificate Remote Actions]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/remote-actions/
[FAQ: Private Key Health]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/faq-private-key-health-testing/
[IIS]:https://docs.nodinite.com/install-and-update/troubleshooting/iis/overview/
[Weak Cryptography Detection]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/weak-cryptography-detection/