I decided to go with the following approach:
// store public key SecKeyChain.Add(new SecRecord(SecKind.Key) { ApplicationLabel = userName, Accessible = SecAccessible.AlwaysThisDeviceOnly, KeySizeInBits = 512, KeyClass = SecKeyClass.Public, ValueData = NSData.FromString(publicKey) }); // store private key SecKeyChain.Add(new SecRecord(SecKind.Key) { ApplicationLabel = publicKey, Accessible = SecAccessible.AlwaysThisDeviceOnly, KeySizeInBits = 512, KeyClass = SecKeyClass.Private, CanSign = true, ValueData = NSData.FromString(secretKey) });
This means that each public key is mapped to an individual user, and each private key is mapped to a public key, which allows you to store several user keys (and not just to store current registered users).
Everything seems to be working fine, but is 100% not sure if this is the right way to do such things so that some clarifications are pleasant.
James source share