简体   繁体   English

productsign mac .pkg 安装程序

[英]productsign mac .pkg installer

I need to sign a MacOS installer with .pkg extension.我需要使用 .pkg 扩展名签署 MacOS 安装程序。 I have a .pfx certificate and added it to Keychain.我有一个 .pfx 证书并将其添加到钥匙串。 It contains both certificate and the private key.它包含证书和私钥。

But when I try to sign this .pkg using productsign utility, it shows an error as :但是当我尝试使用productsign实用程序签署这个 .pkg 时,它显示一个错误:

productsign --sign "commonName" unsigned.pkg signed.pkg productsign --sign "commonName" unsigned.pkg signed.pkg

productsign: error: Could not find appropriate signing identity for “commonName”. productsign:错误:找不到“commonName”的适当签名标识。 An installer signing identity (not an application signing identity) is required for signing flat-style products.签名平面产品需要安装程序签名身份(不是应用程序签名身份)。

These steps work for us:这些步骤对我们有用:

  1. Unlock the keychain:解锁钥匙串:

     security unlock-keychain -p {keychain_password} /Users/{your_user}/Library/Keychains/login.keychain-db
  2. List the available signing identities:列出可用的签名身份:

    Note: Code signing identities cannot be used to sign a pkg in mac.注意:代码签名身份不能用于在 mac 中对 pkg 进行签名。 You can find these by adding -p codesigning to the below command.您可以通过将-p codesigning添加到以下命令来找到这些。

     security find-identity -v
  3. Sign an installer using productsign:使用 productsign 为安装程序签名:

    Note: The identity can typically be the long hex code from the above command:注意:标识通常可以是来自上述命令的长十六进制代码:

     productsign --sign "{your_identity}" original.pkg signed.pkg

You have to find out what the name of your pfx is and replace the "commonName" with it.您必须找出 pfx 的名称并用它替换“commonName”。

U should search for something like "Developer ID Application: ..." to sign the package.您应该搜索诸如“开发者 ID 应用程序:...”之类的内容来对包进行签名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mac pkg安装程序分发 - Mac pkg installer distribution Mac 安装程序:如何确定 pkg 安装是否交互 - Mac Installer : How to determine if pkg installation is intercative 如何在 mac 上的 dmg/pkg 中包含安装程序依赖项 - How to include installer dependencies in dmg/pkg on mac Mac OS X安装程序(pkg)和Google Analytics(分析) - Mac OS X Installer (pkg) and Google Analytics Mac中带有安装程序证书的CodeSigning pkg文件 - CodeSigning pkg file with Installer Certificate in Mac Teamcity:Mac 构建代理无法使用 productsign 签署 .pkg 文件。 SignData 失败:CSSMERR_CSP_NO_USER_INTERACTION (-2147415840) - Teamcity: Mac build agent unable to sign .pkg file using productsign. SignData failed: CSSMERR_CSP_NO_USER_INTERACTION (-2147415840) 如何使用productsign在OSX上签署APP安装程序? - How to sign APP installer on OSX using productsign? 如何在Mac PKG安装程序页面中更改按钮文本和位置 - How to change button text and locations in mac pkg installer page 通过Java Applet在Mac OSX上运行.pkg安装程序 - Running a .pkg installer on Mac OSX through java applet 如何制作Mac安装程序只需安装(复制)文件的.pkg文件? - How to make a .pkg that the Mac Installer will simply install (copy) files from?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM