public IList <EntriesDecrypterResult <TKey> > Run(TWorkflowOptions options) { Contract.Requires <ArgumentNullException>(options != null, "options"); /*Contract.Requires<ArgumentException>(!string.IsNullOrWhiteSpace(options.DatFilePath), "DAT file path cannot be null or whitespace");*/ Contract.Requires <ArgumentException>(Contract.ForAll(options.CategoryEntryPair, t => !string.IsNullOrWhiteSpace(t.Category)), "none of the category names can be null or whitespace"); Contract.Requires <ArgumentException>(Contract.ForAll(options.CategoryEntryPair, t => !string.IsNullOrWhiteSpace(t.Entry)), "none of the entry names can be null or whitespace"); /*Contract.Requires<ArgumentException>(typeof(TKey) == typeof(PlainTextKey) || * Contract.ForAll(options.KeyFilePaths, s => !string.IsNullOrWhiteSpace(s)), * "key file path cannot be null or whitespace");*/ Contract.Ensures(Contract.Result <IList <EntriesDecrypterResult <TKey> > >() != null); // var datPoco = _datLoader.Load(GetDatLoaderOptions(options)); var loadedKeys = LoadKeys(options); var ret = _entriesDecrypter.Decrypt(loadedKeys, datPoco, options.CategoryEntryPair, options.ThrowExceptionIfEntryNotFound, options.ThrowIfDecryptingKeyNotFound, options.ThrowIfKeyCannotDecrypt); _auditLogger.LogDecryption(options, datPoco, loadedKeys, ret); return(ret); }