public override IEnumerable <ISalesforceUser> FindAccountsForService(string serviceId) { var r = new List <SalesforceUser> (); var postfix = "-" + serviceId; var aliases = ks.Aliases(); while (aliases.HasMoreElements) { var alias = aliases.NextElement().ToString(); if (alias.EndsWith(postfix)) { var e = ks.GetEntry(alias, prot) as KeyStore.SecretKeyEntry; if (e != null) { var bytes = e.SecretKey.GetEncoded(); var serialized = System.Text.Encoding.UTF8.GetString(bytes); var acct = SalesforceUser.Deserialize(serialized); r.Add(acct); } } } r.Sort((a, b) => a.Username.CompareTo(b.Username)); return(r); }
ISalesforceUser GetAccountFromRecord(SecRecord r) { var serializedData = NSString.FromData(r.Generic, NSStringEncoding.UTF8); return(SalesforceUser.Deserialize(serializedData)); }