public CryptographyResponse Execute(CryptographyRequest req)
 {
     try
     {
         string gnuCmd   = this.cmdInterpretor.InterporateCommandRequest(req);
         string osResult = this.osTerminal.Execute(gnuCmd);
         CryptographyResponse gnuResponse = this.cmdInterpretor.InterporateResponse(req, osResult);
         return(gnuResponse);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
            public void ShouldReturn3FilesFromEmbeddedResourceKeysCompleteWithNameAndByteContent()
            {
                CryptographyRequest    sut   = new GenerateKeyPairRequest();
                IAppCommandInterpretor inter = new GpgCommandInterpretor();

                inter.InterporateCommandRequest(sut);
                string osResult = "Use pre-generated keyFiles.";
                CryptographyResponse response = inter.InterporateResponse(sut, osResult);

                response.Should().NotBeNull();
                response.Files.Should().HaveCount(3);
                response.Files.Should().AllBeOfType <FileInfo>();
                List <FileInfo> files = response.Files.ToList();

                files[0].FileName.Should().Be("FileCryptography.Infrastructure.Data.Keys.FileCryptographyService.Private.gpg");
                files[1].FileName.Should().Be("FileCryptography.Infrastructure.Data.Keys.FileCryptographyService.Public.gpg");
                files[2].FileName.Should().Be("FileCryptography.Infrastructure.Data.Keys.FileCryptographyService.Private.Passphrase.pass");
            }