我需要创建一个独立的PKCS7签名,用于Apple Wallet传递。
private function createSignature()
{
$cert = '/etc/ssl/local.crt';
$key = '/etc/ssl/local.key';
$wwdr = '/var/www/app/storage/passes/AppleWWDRCA.cer';
$headers = [
'signing-time' => (new DateTime())->format('o-m-d H:i:s'),
];
return openssl_pkcs7_sign("$this->dir/manifest.json", "$this->dir/signature",
$cert, $key, $headers, PKCS7_DETACHED, $wwdr);
}
openssl_pkcs7_sign(): no certificates in file, /var/www/app/storage/passes/AppleWWDRCA.cer
AppleWWDRCA.cer
已从https://www.apple.com/certificateauthority/下载。我下载的确切证书是WWDR Certificate (Expiring 02/07/23)
。我查看了该文件并确认它不是空白。我错过了一步吗?
答案 0 :(得分:4)
通过将AppleWWDR.cer添加到我的钥匙串并将其从钥匙串中导出为.pem
文件来解决该问题。