简体   繁体   English

我可以使用MonoTouch访问iPhone上的钥匙串吗?

[英]Can I access the keychain on the iPhone with MonoTouch?

I have recently started to develop applications for iPhone with MonoTouch and have to store user names and passwords on the phone. 我最近开始使用MonoTouch开发iPhone的应用程序,并且必须将用户名和密码存储在手机上。 I want to use the keychain for this but can't find anything in the MonoTouch documentation about it. 我想为此使用钥匙串,但是在MonoTouch文档中找不到有关它的任何内容。 Is it possible to use it directly with MonoTouch or will I have to write some C++/C/Objective-C code that uses the keychain and export it to MonoTouch? 是否可以将其直接与MonoTouch一起使用,还是必须编写一些使用钥匙串的C ++ / C / Objective-C代码并将其导出到MonoTouch?

According to the current documentation , there is no bindings for the keychain. 根据当前文档 ,钥匙串没有绑定。

Your solutions are: 您的解决方案是:

  • post a request to Novell for the bindings. 向Novell发布绑定请求。
  • write a .NET wrapper around the KeyChain function by accessing them through P/Invoke. 通过P / Invoke访问KeyChain函数周围的.NET包装器。 The following page gives you some hint on how to do it. 以下页面为您提供了一些提示。 If you need some direction on how to provide an object-oriented wrapper for KeyChain, you can take some inspiration from the EMKeyChain library . 如果您需要有关如何为KeyChain提供面向对象的包装的指导,可以从EMKeyChain库中获得一些启发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM