示例#1
0
 public IList <EntriesDecrypterResult <TKey> > Decrypt(
     TKey usingKey,
     EnvCryptDat inDat,
     CategoryEntryPair categoryEntryPair,
     bool throwExceptionIfEntryNotFound = true,
     bool throwIfDecryptingKeyNotFound  = true,
     bool throwIfKeyCannotDecrypt       = true)
 {
     Contract.Requires <ArgumentNullException>(usingKey != null, "usingKey");
     Contract.Requires <ArgumentNullException>(inDat != null, "inDat");
     //
     return(this.Decrypt(new[] { usingKey }, inDat, new[] { categoryEntryPair }, throwExceptionIfEntryNotFound,
                         throwIfDecryptingKeyNotFound, throwIfKeyCannotDecrypt));
 }
示例#2
0
 public IList <EntriesDecrypterResult <TKey> > Decrypt(
     IList <TKey> usingKeys,
     EnvCryptDat inDat,
     CategoryEntryPair categoryEntryPair,
     bool throwExceptionIfEntryNotFound = true,
     bool throwIfDecryptingKeyNotFound  = true,
     bool throwIfKeyCannotDecrypt       = true)
 {
     Contract.Requires <ArgumentNullException>(usingKeys != null, "usingKeys");
     Contract.Requires <ArgumentException>(usingKeys.Any(), "usingKeys");
     Contract.Requires <EnvCryptException>(Contract.ForAll(usingKeys, k => k != null), "all keys in the list can be null");
     Contract.Requires <ArgumentNullException>(inDat != null, "inDat");
     //
     return(this.Decrypt(usingKeys, inDat, new[] { categoryEntryPair }, throwExceptionIfEntryNotFound,
                         throwIfDecryptingKeyNotFound, throwIfKeyCannotDecrypt));
 }