私はopensslでコーディングしていますが、openssl_sign関数がopenssl_private_encrypt
論理的な意味とは異なる結果をもたらす理由を知りたいです。
具体的には openssl_sign を使用:
$fp = fopen("i.pem", "r"); //i.pem is the private key file
$priv_key = fread($fp, 8192);
fclose($fp);
$pkeyid = openssl_get_privatekey($priv_key);
$data="f2e140eb-2b09-44ab-8504-87b25d81914c";
openssl_sign($data, $signature, $pkeyid);
$reto22 = base64_encode($signature); //this gives UNmlEfwISea9hoGfiwdM.......
特に openssl_private_encrypt を使用する場合:
$llave_priv = file_get_contents("i.pem"); //i.pem is the private key file
$plaintext = "f2e140eb-2b09-44ab-8504-87b25d81914c";
openssl_private_encrypt($plaintext, $encrypted, $llave_priv);
$reto = base64_encode($encrypted); //this gives ugSMAsCQlIKIlQ17exIvSEqkA60.......
reto22
がと異なるのはなぜ$reto
ですか? それらは同じであるべきですよね?priv key = sign
私の知る限り、で暗号化する
マリオを明確にしてくれてありがとう