wabbajack/Wabbajack.CLI/Verbs/Decrypt.cs

24 lines
839 B
C#
Raw Normal View History

using System.Threading.Tasks;
using Alphaleonis.Win32.Filesystem;
2020-01-31 22:38:56 +00:00
using CommandLine;
using Wabbajack.Common;
namespace Wabbajack.CLI.Verbs
{
[Verb("decrypt", HelpText = @"Decrypt data from AppData\Local\Wabbajack and store it locally", Hidden = true)]
public class Decrypt : AVerb
2020-01-31 22:38:56 +00:00
{
[Option('n', "name", Required = true, HelpText = @"Credential to encrypt and store in AppData\Local\Wabbajack")]
2020-04-09 22:36:07 +00:00
public string Name { get; set; } = "";
2020-01-31 22:38:56 +00:00
[Option('o', "output", Required = true, HelpText = @"Output file for the decrypted data")]
2020-04-09 22:36:07 +00:00
public string Output { get; set; } = "";
2020-01-31 22:38:56 +00:00
2020-04-06 17:14:46 +00:00
protected override async Task<ExitCode> Run()
2020-01-31 22:38:56 +00:00
{
await Output.RelativeTo(AbsolutePath.EntryPoint).WriteAllBytesAsync(await Utils.FromEncryptedData(Name));
2020-01-31 22:38:56 +00:00
return 0;
}
}
}