Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to LTS #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ class Program

static async Task Main(string[] args)
{
AnsiConsole.Render(
AnsiConsole.Write(
new FigletText("Passwordless.dev")
.LeftAligned()
.LeftJustified()
.Color(Color.Yellow));

AnsiConsole.Render(new Rule());
AnsiConsole.Write(new Rule());
AnsiConsole.MarkupLine("A small tool built by Anders at https://passwordless.dev to remove Windows 10 WebAuthn Keys");
AnsiConsole.MarkupLine("Use the Github repo to report issues or contribute: https://github.com/passwordless/webauthn-fido2-key-remover");
AnsiConsole.WriteLine();
AnsiConsole.MarkupLine("[bold]Note:[/] To delete keys, you need to run this tool as administrator. If you do not want to do that, you can run `certutil -csp NGC -delkey <name>` manually.");
AnsiConsole.Render(new Rule());
AnsiConsole.Write(new Rule());

// Load keys using certutil
string keyString = "";
Expand All @@ -46,7 +46,7 @@ await AnsiConsole.Status()
using (StringReader reader = new StringReader(keyString))
{
string line;
while ((line = reader.ReadLine()) != null)
while ((line = await reader.ReadLineAsync()) != null)
{
if (line.Contains("FIDO"))
{
Expand Down Expand Up @@ -86,7 +86,7 @@ await AnsiConsole.Status()
AnsiConsole.MarkupLine(k);
}

// Confirm deleteion?
// Confirm deletion?
if (!AnsiConsole.Confirm("Delete " + keysToBeDeleted.Count + " keys?"))
{
return;
Expand All @@ -96,8 +96,8 @@ await AnsiConsole.Status()
foreach (var key in keysToBeDeleted)
{
var rule = new Rule("[red]Deleting... [/]" + key);
rule.Alignment = Justify.Left;
AnsiConsole.Render(rule);
rule.Justification = Justify.Left;
AnsiConsole.Write(rule);

var id = Convert.ToInt32(key.Split(".")[0]);
var name = keys.Single(x => x.Id == id).Name;
Expand Down
6 changes: 3 additions & 3 deletions src/webauthn-fido2-key-remover.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>webauthn_fido2_key_remover</RootNamespace>
<ApplicationIcon>passless.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CliWrap" Version="3.3.2" />
<PackageReference Include="Spectre.Console" Version="0.39.0" />
<PackageReference Include="CliWrap" Version="3.6.4" />
<PackageReference Include="Spectre.Console" Version="0.47.0" />
</ItemGroup>

</Project>