I've read (parts of) your code, and I noticed the commend about case-sensetive checking only beeing to set in the db, however, I though I'd show you this little technique I use to achive the same with minimal overhead:
CryptoKey ICryptoKeyStore.GetKey(string bucket, string handle)
{
// It is critical that this lookup be case-sensitive, which can only be configured at the database.
var _db = SymetricCryptoKeys.Where(k => k.Bucket == bucket && k.Handle == handle).ToList();
var matches = from key in _db // hack to make case-sensitive
where key.Bucket == bucket && key.Handle == handle
select new CryptoKey(key.Secret, key.ExpiresUtc.AsUtc());
return matches.FirstOrDefault();
}
Notice that the last itteration is done on in-memory objects, thus the comparison is done in C#, not in the db.
I've read (parts of) your code, and I noticed the commend about case-sensetive checking only beeing to set in the db, however, I though I'd show you this little technique I use to achive the same with minimal overhead:
Notice that the last itteration is done on in-memory objects, thus the comparison is done in C#, not in the db.