Skip to content

Show private key state & allow healing#16

Open
episource wants to merge 7 commits into
masterfrom
feature/edit-ekf-show-state-and-heal
Open

Show private key state & allow healing#16
episource wants to merge 7 commits into
masterfrom
feature/edit-ekf-show-state-and-heal

Conversation

@episource

@episource episource commented Jul 22, 2026

Copy link
Copy Markdown
Owner

The following changes are introduced:

  • The "Edit Encrypted Key File" Dialog also shows private key connections state (optionally use this as early indicator, whether there might be a incompatibility)
  • add private key state "mismatch" (in addition to "connected", "not connected") - "mismatch" is shown if querying the private key fails with either NTE_BAD_PUBLIC_KEY or NTE_BAD_KEY. Both are likely related to corruption/misconfiguration of the system's certificate store.
  • allow healing when querying private key properties (disable CRYPT_ACQUIRE_NO_HEALING option) - healing will sometimes solve NTE_BAD_PUBLIC_KEY issues*
  • also pulls in the changes of Optionally filter key usage in frontend #14

*) On my systems I needed to fiddle with the CERT_KEY_PROV_INFO_PROP_ID provider property associated with a cert to force NTE_BAD_PUBLIC_KEY: I've overwritten this with the value of another certificate (for another key slot, but sharing the same algorithm parameters). Enabling healing worked around this forced NTE_BAD_PUBLIC_KEY. I'm not aware of negative side effects that might come along with the healing, other that it might change persistent provider data.

I could imagine, that NTE_BAD_PUBLIC_KEY might also occur, when the key on the smartcard is recreated / overwritten without updating the computer's or key file's cached certificate. Was not able to easily reproduce this though (e.g. overwriting a yubikey PIV slot led to "not connected" / NTE_BAD_KEYSET during my testing).

NTE_BAD_KEYSET is raised *before* a key is actually retrieved. It means the provider cannot locate the requested key container. This is not a mismatch. It only means a card using the same provider is accessable.
@episource episource changed the title Always show private key state & allow healing Show private key state & allow healing Jul 22, 2026
@episource episource self-assigned this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant