问题标签 [keychain]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
32709 浏览

command-line - 如何通过命令行为 iOS 开发安装开发者证书/私钥和配置文件?

我正在为 iOS 应用程序项目配置自动构建服务器。我已经完成了大部分。现在,这是最后一轮。安全。

开发人员证书/私钥和配置文件可以通过 GUI 轻松安装到钥匙串中。但我想通过命令行来自动化配置过程。通过命令行导出/导入证书、私钥、配置文件。

任何建议将不胜感激。

0 投票
2 回答
10979 浏览

ios - 在 iOS 上查找证书

请注意,这个问题是在 2001 年提出的。情况发生了变化。

我有一台需要访问 Junos VPN 的 iOS 设备。Junos 管理员的不透明说明说我必须检索已使用 Apple IPCU 配置到设备的证书。我知道证书在设备上(我可以在“设置”中看到),我可以通过 Mail、Safari 和 Junos App 访问 VPN。

Apple 文档声明每个应用程序都有自己的钥匙串,但所有这三个应用程序都可以看到证书。Jusos 可以访问 IPCU 提供的证书这一事实意味着任何应用程序都可以访问此证书。但是,当我尝试找到它时:

它失败。我的问题:

  • 这段代码正确吗?其实我知道这不是因为 SecItemCopyMatching退货 errSecItemNotFound

  • 我应该使用什么值 certLabelString- 我假设设置中显示的人类可读名称。

在设置中,证书看起来像这样(可悲的是被混淆了)我指定的搜索文本正是设置中显示的文本。

替代文字

Cross 发布到Apple 开发者论坛

0 投票
1 回答
3427 浏览

xcode - iOS 分发:将私钥/证书迁移到新机器

我需要能够从与我用来提交原始文件的机器不同的机器上提交对我的应用程序的更新。我按照文档中的说明进行操作,但是,像往常一样,文档假定一切都在第一次正常工作。

我尝试将我的开发者资料从旧的导出到新的,但是当我提交时,App Loader 说它是无效的签名。所以我尝试生成新证书(为了在供应门户中执行此操作,您必须撤销现有证书)。它仍然没有工作。

最后,我不得不去回收没有被擦除的旧机器,并且能够从中提交我的更新。

除了不完整的 Apple 文档之外,我还需要采取哪些步骤将我的开发人员证书移植到新机器上,以便我可以使用相同的分发配置文件提交?

如果我撤销了现有证书,我该怎么办?我可以使用仍然适用于应用程序更新的原始“私钥”重新生成那些吗?

谢谢

0 投票
1 回答
1539 浏览

iphone - 使用 KeychainItemWrapper iPhone SDK 时收到 SIGABRT

我正在编写一个使用“KeychainItemWrapper”类以安全方式存储登录凭据的应用程序。下面是管理 Keychain 对象的代码:

当我尝试在钥匙串中写入凭据时收到 SIGABRT 错误,这里:

0 投票
1 回答
2353 浏览

iphone - Storing certificate chains in the application keychain

On iOS, I know that we can evaluate a trust with SecTrustEvaluate(). To create a trust, we either import it from a *.p12 file or create it using an array of certificates and a set of policies.

I also know that in order to ensure that a server, that is not trusted by default, is trusted, we can use SecTrustSetAnchorCertificates() to augment the list of root CAs SecTrustEvaluate() uses to verify the server's certificate.

Now, how can I ensure that these anchor certificates are available on a subsequent launch? I can store certificates, keys and identities in the application keychain, but not a certificate chain. Even if I store all the certificates in the chain, how will I know what certificates are to be used as anchor certificates?

One solution that comes to mind is to just get all the certificates from the keychain and set them as anchor certificates. Another method could be to all the certificate chains on the disk as *.p12 files and load them once on every application run.

0 投票
3 回答
5842 浏览

iphone - SecTrustEvaluate() 是否在应用程序钥匙串中查找根证书?

文档说:“如果不是所有验证叶证书所需的证书都包含在信任管理对象中,那么 SecTrustEvaluate 在钥匙串搜索列表(请参阅 SecTrustSetKeychains)和系统的锚证书存储(请参阅 SecTrustSetAnchorCertificates)中搜索证书。”

但是,由于 SecTrustSetKeychains() 在 iOS 上不可用,尚不清楚此函数是否也会在应用程序的钥匙串中查找。

0 投票
3 回答
2264 浏览

iphone - kSecReturnPersistentRef 有什么作用?

它是否使密钥链项在应用程序运行之间持久化?

0 投票
1 回答
1525 浏览

security - OS X 钥匙串:提取私钥——可能吗?

我正在尝试提取存储在 OS X 中的私钥的原始字节SecKeyRef。我将如何做呢?

我在 Apple CDSA 讨论列表中阅读了这个~ 7 年前的帖子,但没有发现任何更新的内容。我没有与该线程中的原始海报相同的问题,但这可能是因为我做错了事。这是我目前正在尝试的(无济于事):

返回的错误代码CSSM_WrapKeyCSSMERR_CSP_INVALID_KEYATTR_MASK。有任何想法吗?

0 投票
1 回答
1134 浏览

security - 将 SecKeyRef、SecIdentityRefs 添加到 OS X 钥匙串

存在方便的SecCertificateAddToKeychain()功能,它允许开发人员将“浮动”证书(例如SecCertificateRef由 生成的实例SecCertificateCreateWithData())添加到钥匙串。

SecKeyRefSecIdentityRef实例的等效函数在哪里?有SecKeychainItemImport(),但它用于导入原始数据。也有SecItemAdd(),但仅限于添加密码。

我错过了什么?

0 投票
9 回答
118499 浏览

ios - 卸载应用程序时删除钥匙串项

我正在使用idandersen 的 scifihifi-iphone代码作为钥匙串并使用保存密码

当我从设备中删除应用程序时,密码仍保留在钥匙串中。

当用户从设备中删除应用程序时,我想从钥匙串中删除密码。我怎样才能做到这一点?