iPhone 是否有一个可以使用 HMAC-SHA-1 编码的库
对于使用 Amazon 服务(S3、EC2、SimpleDB)的所有操作,您需要使用 HMAC-SHA-1 签名对所有请求进行签名(http://en.wikipedia.org/wiki/HMAC 、http://docs.amazonwebservices.com/AWSFWS/latest/DeveloperGuide/index.html?SummaryOfAuthentication.html)。
我在asp.net后端下工作,没有任何问题。 问题出在 iPhone 应用程序中。 iPhone开发者表示无法使用HMAC-SHA-1编码,他无权实现自己的算法。 作为程序员,我无法理解为什么会出现问题。
所以我也想知道 iPhone 开发商是对吗?
我从未为 iPhone 编写过代码,所以我什至不知道在哪里搜索此类信息。
For all operation with Amazon services(S3, EC2, SimpleDB) You need to sign all resquest with HMAC-SHA-1 Signature(http://en.wikipedia.org/wiki/HMAC , http://docs.amazonwebservices.com/AWSFWS/latest/DeveloperGuide/index.html?SummaryOfAuthentication.html).
I'm working under asp.net backend and there is no problems. Problem is in the iPhone application. iPhone developer says that there is no way to use HMAC-SHA-1 encoding, and he have no rigths to implement his own algorithm. As programmer I cannot understand why there can be a problem.
So I want too know is iPhone developer right?
I've never coded for iPhone, so I don't even where to search such an information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
CommonCrypto 就可以解决这个问题。
然后稍后
CommonCrypto does the trick.
then later
CommonCrypto 会做到这一点。 但如果你想要代码,我这里有一些:
http://oauth .googlecode.com/svn/code/obj-c/OAuthConsumer/Crypto/
这是我为在 Cocoa OAuth 实现中使用而编写的:http://code.google.com/p/oauthconsumer/wiki/UsingOAuthConsumer
CommonCrypto will do it. But if you want code, I have some here:
http://oauth.googlecode.com/svn/code/obj-c/OAuthConsumer/Crypto/
Which I wrote for use in the Cocoa OAuth implementation: http://code.google.com/p/oauthconsumer/wiki/UsingOAuthConsumer
这篇文章演示了一个小函数,它将生成一个 SHA-1 哈希摘要,该摘要将与如果您给它相同的输入,将生成 php sha1() 函数:
This article demonstrates a little function that will generate an SHA-1 hash digest that will match what the php sha1() function will generate if you give it the same input:
一点谷歌搜索,我发现 本文档。
我还发现这个:
(不是直接回答您的问题,但肯定是相关的。)
A bit of googling and I found this document.
I also found this:
(Not a direct answer to your question, but certainly pertinent.)
不适用于 iPhone,但库 libs3 提供了 C API用于访问 Amazon 的 S3 服务。 它或 FUSE s3fs 组件可能是提取通信所需例程的良好来源与亚马逊的网络服务。 由于 Objective-C 的核心仍然是 C,因此这些例程在 iPhone 上应该可以正常工作。
我认识至少一位开发人员,他们在 iPhone 应用程序中使用类似的东西来与 S3 存储桶进行通信。
Not for iPhone in particular, but the library libs3 provides a C API for accessing Amazon's S3 services. It, or the FUSE s3fs component, may be good sources for extracting the routines needed to communicate with Amazon's Web Services. As Objective-C is still C at its core, these routines should work just fine on the iPhone.
I know at least one developer who is using something similar within their iPhone application to communicate with S3 buckets.
我认为 CommonCrypto 库会做你想要的。 看这个文件:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/usr/include/CommonCrypto/CommonHMAC.h
I think the CommonCrypto library will do what you want. Look at this file:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/usr/include/CommonCrypto/CommonHMAC.h
我不知道现在是否仍然如此,但加密算法曾经受到限制,并且您将其分发到某些国家的权利也受到限制。
如果情况仍然如此,则可能是 Apple 不希望/无法限制某些应用程序在这些国家/地区下载。
I don't know if this is the case anymore, but there used to be restrictions on encryption algorithms and your right to distribute them to certain countries were restricted.
If this is still the case it could be that Apple don't want/can't restrict certain applications from being downloaded in these countries.