【问题标题】:Open/View certificate programatically on a macOS在 macOS 上以编程方式打开/查看证书
【发布时间】:2021-10-24 14:22:14
【问题描述】:

macOS 中是否有任何选项可以以编程方式显示证书。

类似的东西:

【问题讨论】:

  • 无论如何我从@MarekH 得到了答案..谢谢。 SFCertificatePanel.shared().beginSheet(for: nil, modalDelegate: nil, didEnd: nil, contextInfo: nil, 证书: [seccert!], showGroup: false)

标签: swift macos


【解决方案1】:

正如@MarekH 所述,SecCertificateCreateWithData 可用于显示来自应用程序的证书

 DispatchQueue.main.async {
                    let certData = //read certificate file
                            let cert = SecCertificateCreateWithData(kCFAllocatorDefault, certData! as CFData)
                            SFCertificatePanel.shared().beginSheet(for: self.view.window, modalDelegate: nil, didEnd: nil, contextInfo: nil, certificates: [cert!], showGroup: false)
                        }
                    

【讨论】:

    猜你喜欢
    • 2021-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-02
    • 1970-01-01
    相关资源
    最近更新 更多