2020-02-11 05:04:56 +00:00
|
|
|
|
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("encrypt", HelpText = @"Encrypt local data and store it in AppData\Local\Wabbajack", Hidden = true)]
|
2020-02-11 05:04:56 +00:00
|
|
|
|
public class Encrypt : AVerb
|
2020-01-31 22:38:56 +00:00
|
|
|
|
{
|
|
|
|
|
[Option('n', "name", Required = true, HelpText = @"Credential to encrypt and store in AppData\Local\Wabbajack")]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = @"Source data file name")]
|
|
|
|
|
public string Input { get; set; }
|
|
|
|
|
|
2020-02-11 05:04:56 +00:00
|
|
|
|
protected override async Task<int> Run()
|
2020-01-31 22:38:56 +00:00
|
|
|
|
{
|
2020-02-11 05:04:56 +00:00
|
|
|
|
File.ReadAllBytes(Input).ToEcryptedData(Name);
|
2020-01-31 22:38:56 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|