Stepan Pogrebelny
Stepan Pogrebelny

Reputation: 1

X509Certificate2: Internal error

When I try to execute code below I got an error:

Internal error occurred.

var certificate = new X509Certificate2( p12FileBytes, p12FilePassword );

when I added

X509KeyStorageFlags.MachineKeySet(
   new X509Certificate2(
      p12FileBytes, p12FilePassword,  X509KeyStorageFlags.MachineKeySet)).

I got another error:

Access Denied.

How can I fix it?

Thanks in advance.

Regards,

Stepan.

Upvotes: 0

Views: 746

Answers (1)

abatishchev
abatishchev

Reputation: 100238

Run the second code with elevated privileges.

Upvotes: 1

Related Questions