iphone - 数字身份等于公钥+私钥?

标签 iphone ios xcode code-signing

我正在阅读有关 iOS 中的应用程序代码签名的内容,但我不明白为什么私钥和公钥在一起?当您使用私钥对应用程序进行签名时,公钥和证书的用途是什么?

enter image description here

Xcode uses your digital identity to sign your application during the build process. This digital identity consists of a public-private key pair and a certificate. The private key is used by cryptographic functions to generate the signature. The certificate is issued by Apple; it contains the public key and identifies you as the owner of the key pair.

最佳答案

让我们总结一下整个过程:

您使用私钥对应用程序可执行文件的哈希摘要(例如 md5 或 sha-1)进行加密。这就是“签名”。

您的用户使用您的公钥对其进行解密(他们拥有它,因为它是公开的),并根据可执行文件进行检查。只要您的私钥保持私密,就是您对其进行“签名”。这就是所谓的“验证”。

那么数字身份又如何呢:

您的公钥本身并不是公开的,它必须以某种方式共享、“公开”,并且也由认证机构(以下简称 CA)签名(即加密它的 CA —或者它的散列 - 使用他们的,神奇的神秘私钥之一)这保证了共享过程没有被中间人篡改。

因此,公钥和证书(CA 签名 - CA 加密您的公钥)识别您的身份(因此被视为您的“数字身份”的一部分)并且必须以某种方式到达最终用户(通过第三方,嵌入到可执行文件中,您可以指定方式)

关于iphone - 数字身份等于公钥+私钥?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9539019/

相关文章:

iphone - 比 AVAudioPlayer 更快的替代品?

iphone - 按下锁定按钮时 AVAudioRecorder 停止

ios - 我的 ViewController 中的每个 textField 输入都必须有 textField.delegate=self

ios - 检查日期是否早于当前日期(Swift)

ios - 合并两个xcode项目并根据条件运行

iphone - Apple 应用程序加载器 - 如何更改正在使用的 Apple ID?

ios - 将 sqlite 数据库重置为默认值

ios - [cell addSubview :button] and [cell. contentview addsubview:button] 之间有什么区别

ios - 如何在 iOS 数字键盘上显示 "Done"按钮?

xcode - : -fno-objc-arc 中的未知选项字符 `f'