Macで証明書を使用して署名を作成しようとしました:
$pkcs12 = file_get_contents($this->certPath);
$certs = array();
if(openssl_pkcs12_read($pkcs12, $certs, $this->certPass) == true) {
$certdata = openssl_x509_read($certs['cert']);
$privkey = openssl_pkey_get_private($certs['pkey'], $this->certPass );
openssl_pkcs7_sign($paths['manifest'], $paths['signature'], $certdata, $privkey, array(), PKCS7_BINARY | PKCS7_DETACHED);
$signature = file_get_contents($paths['signature']);
$signature = $this->convertPEMtoDER($signature);
file_put_contents($paths['signature'], $signature);
return true;
}
しかし、それは私に与えます:
警告: openssl_x509_read(): 提供されたパラメーターを強制的に X509 証明書にすることはできません!
UTF-8 BOM の問題だと言っている人を見つけましたが、この場合は問題ではありません。どうすればよいですか?
ありがとう!