【发布时间】:2014-02-21 10:38:11
【问题描述】:
我正在尝试使用 CryptoCommon 类,但无法在 monotuch 程序集中找到它。
我找到了 Mono.Security.Cryptography 程序集,它的性能是否与 CryptoCommon 类相同?
谢谢!!
【问题讨论】:
标签: ios xamarin.ios cryptography xamarin commoncrypto
我正在尝试使用 CryptoCommon 类,但无法在 monotuch 程序集中找到它。
我找到了 Mono.Security.Cryptography 程序集,它的性能是否与 CryptoCommon 类相同?
谢谢!!
【问题讨论】:
标签: ios xamarin.ios cryptography xamarin commoncrypto
CommonCrypto 在 Xamarin.iOS 内部使用,这不是额外的 - 即无需选择加入或退出。
这意味着它的使用对您的代码完全透明。如果 CommonCrypto 中提供算法,则使用 classic .NET 类型将使用它。
例如
// this will use CommonCrypto. AES is supported by CommonCrypto
// if your device supports it AES can be hardware accelerated
var aes = Aes.Create ();
// this will also use CommonCrypto. SHA-1 is supported by CommonCrypto
// if your device supports it SHA-1 can be hardware accelerated
var sha = new SHA1Managed ();
// this will not use CommonCrypto since the algorithm is not supported by Apple
var r = RIPEMD160.Create ();
更多关于 CommonCrypto 的 information 可以在我的博客上找到。
【讨论】: