1

I'm trying to create an exportable key set using aspnet regiis, here is the command I'm running:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pc "SampleKeys" -exp

But the response is the same as if the tool is given a command it doesn't recognise:

Administration utility (4.0.30319) to install and uninstall ASP.NET on the local machine.
Copyright (c) Microsoft Corporation. All rights reserved.

Followed by regular command-line help section

So I ommitted the -exp flag and just ran

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pc "SampleKeys"

Which worked fine, but when I try to export the key using this command:

aspnet_regiis -px "SampleKeys" "C:\SampleKeys.xml" -pri

I get the following:

Exporting RSA Keys to file...
Key not valid for use in specified state.

Failed!

Has anyone had this problem before? I seemed to be able to do this without issue a few months ago. I've tried this on several machines and different .NET versions already and the same result is returned....

ShaneC
  • 2,237
  • 2
  • 32
  • 53

1 Answers1

1

I don't know how but right after I posted this question I was able to create an exportable key set using the same command I used before:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pc "SampleKeys" -exp

Keys are importable on other machines and work as expected

ShaneC
  • 2,237
  • 2
  • 32
  • 53
  • The same thing happened to me. I executed the command from a different path to see it was because of rights, and it worked. I re launched it in the Framework folder and it worked. If someone has an explanation, I'll be glad to hear it. – Loïc Lopes May 10 '17 at 08:13