-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGenerateKeyForAesGcm256Command.cs
More file actions
41 lines (37 loc) · 1.22 KB
/
Copy pathGenerateKeyForAesGcm256Command.cs
File metadata and controls
41 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using TreeBasedCli;
namespace Samples.CryptoKit
{
public class GenerateKeyForAesGcm256Command :
LeafCommand<
GenerateKeyForAesGcm256Command.Arguments,
GenerateKeyForAesGcm256Command.Parser,
GenerateKeyForAesGcm256Command.Handler>
{
public GenerateKeyForAesGcm256Command() : base(
label: "generate-key",
description: new[]
{
"Generate a 256-bit cryptographic key and print it in base64."
},
options: new CommandOption[] { })
{ }
public record Arguments() : IParsedCommandArguments;
public class Parser : ICommandArgumentParser<Arguments>
{
public IParseResult<Arguments> Parse(CommandArguments arguments)
{
return new SuccessfulParseResult<Arguments>(
new Arguments()
);
}
}
public class Handler : ILeafCommandHandler<Arguments>
{
public Task HandleAsync(Arguments arguments, LeafCommand _)
{
Console.WriteLine($"here is your new key: 'blah blah blah'");
return Task.CompletedTask;
}
}
}
}