如何在coldfusion中进行Apple签名和压缩通行证优惠券(Wallet Passkit)。我在谷歌搜索,但没有找到任何有用的来源。
我只发现了这个链接,但是这个家伙也一直在寻求帮助.. Link
如果有人知道可以使用它的 JAVA jar 文件将会非常有帮助。
如果有人已经这样做,请分享知识。
在PHP中,这就是我在COLDFUSION中需要考虑的事情。 有点卡住
//load .p12 certificate
$PKCS12 = file_get_contents($Certificates['Certificate']);
$certs = array();
if(openssl_pkcs12_read($PKCS12, $certs, $Certificates['CertPassword']) == true)
{
$certdata = openssl_x509_read($certs['cert']);
$privkey = openssl_pkey_get_private($certs['pkey'], $Certificates['CertPassword']);
}
//sign file hashes with AppleWWDRCA certificate
openssl_pkcs7_sign($ManifestPath, $SignaturePath, $certdata, $privkey, array(), PKCS7_BINARY | PKCS7_DETACHED, $Certificates['AppleWWDRCA']);
$ManifestSignature = file_get_contents($SignaturePath);
$ManifestSignatureDER = PEM2DER($ManifestSignature);
//put files (and strings as files) in a zip archive
$ZIP = new ZipArchive();
$ZIP->open($PKPassPath, ZIPARCHIVE::CREATE);
$ZIP->addFromString('signature', $ManifestSignatureDER);
$ZIP->addFromString('manifest.json', $Manifest);
$ZIP->addFromString('pass.json', $JSON);
foreach($ImageFiles as $ImagePath)
{
$ImageName = basename($ImagePath);
$ZIP->addFile($ImagePath, $ImageName);
}
$ZIP->close();
//load pass data und delete temp files (if debug mode is off)
$Pass['data'] = file_get_contents($PKPassPath);
$Pass['size'] = filesize($PKPassPath);
$Pass['name'] = $PassName;
function echoPass($Pass)
{
//send http headers and zip archive content to client
header('Pragma: no-cache');
header('Content-type: application/vnd.apple.pkpass');
header('Content-length: '.$Pass['size']);
header('Content-Disposition: attachment; filename="'.$Pass['name'].'.pkpass"');
echo $Pass['data'];
}
由于