I'm getting 'Can't get certificates' error.
stack trace:
OpenSslService.php
public function getCertificatesFromPkcs7($certificatePath) {
$getCertificatesCommand = ['openssl', 'pkcs7', '-inform', 'DER', '-in', $certificatePath, '-print_certs'];
$commandOutput = $this->runCommand($getCertificatesCommand);
// This gives me 'Unable to load PKCS7 object'. I've tested it outside the script, storing $certificatePath file.
}
PKCS7SignatureValidator.php
private function extractCertificates($signature) {
$pkcs7TemporaryFile = $this->temporaryFileService->createFile($signature);
$certificates = $this->openSslService->getCertificatesFromPkcs7($pkcs7TemporaryFile->getPath());
}
public function validate(array $paymentData, $rootCertificatePath, $signatureExpirationTime) {
$signature = base64_decode($paymentData['signature']);
$certificates = $this->extractCertificates($signature);
}
Could you please guide me in the right direction? As far as I can see, either my paymentData is wrong or that $signature saved into the file is not of *.p7b format (PKCS7)
I'm getting 'Can't get certificates' error. stack trace: OpenSslService.php public function getCertificatesFromPkcs7($certificatePath) { $getCertificatesCommand = ['openssl', 'pkcs7', '-inform', 'DER', '-in', $certificatePath, '-print_certs']; $commandOutput = $this->runCommand($getCertificatesCommand); // This gives me 'Unable to load PKCS7 object'. I've tested it outside the script, storing $certificatePath file. }
PKCS7SignatureValidator.php private function extractCertificates($signature) { $pkcs7TemporaryFile = $this->temporaryFileService->createFile($signature); $certificates = $this->openSslService->getCertificatesFromPkcs7($pkcs7TemporaryFile->getPath()); } public function validate(array $paymentData, $rootCertificatePath, $signatureExpirationTime) { $signature = base64_decode($paymentData['signature']); $certificates = $this->extractCertificates($signature); }
Could you please guide me in the right direction? As far as I can see, either my paymentData is wrong or that $signature saved into the file is not of *.p7b format (PKCS7)