Question

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....

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top