You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created key and signature in React-Native and now I want to verify it in php. I am using this code but it's always give me the failure and give me the error like error:0906D06C:PEM routines:PEM_read_bio:no start line .
I am new in php. Please help me with this.
Here is my php code ::
<?php
// Sample data to sign
$dataToSign = 'some message';
$publicKey = '';
// Create a signature using the private key
$signature = '';
// Sample public key (in PEM format)
$publicKeyPEM = <<<EOD
-----BEGIN PUBLIC KEY-----
${publicKey}
-----END PUBLIC KEY-----
EOD;
// Verify the signature using the public key
$verified = openssl_verify($dataToSign, $signature, $publicKeyPEM, OPENSSL_ALGO_SHA256);
echo 'Signature verification result: ' . ($verified === 1 ? 'Success' : openssl_error_string()) . PHP_EOL;
?>
The text was updated successfully, but these errors were encountered:
I have created key and signature in React-Native and now I want to verify it in php. I am using this code but it's always give me the failure and give me the error like error:0906D06C:PEM routines:PEM_read_bio:no start line .
I am new in php. Please help me with this.
Here is my php code ::
The text was updated successfully, but these errors were encountered: