private SecStatusCode RemoveRecord(string key)
{
SecStatusCode ssc;
SecRecord found = GetRecord(key, out ssc);
// if it exists, delete it
if (ssc == SecStatusCode.Success)
{
// this has to be different that the one queried
var sr = new SecRecord(SecKind.GenericPassword);
sr.Account = key;
sr.ValueData = found.ValueData;
return SecKeyChain.Remove(sr);
}
return SecStatusCode.NoSuchKeyChain;
}
}