سؤال

I use .NET\C# to manage Windows user's certificate. When I use X509Store.Add() method it works for some users, but it sometimes fails with "Internal Error".

What could be a cause?

هل كانت مفيدة؟

المحلول

It turned out that the problem was only with new users which were created by code. Further investigation revealed that there was the cause was a missing home directory. Windows has troubles with importing a certificate (with priv key) to a user without its profile directory already created, hence "Internal Error".

The solution was to force creation of the home directory for all new users created by code.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top