我需要使用SHA1RSA对数字签名进行数字签名,我该怎么做?
class MyEncryption
{
public $pubkey = '...public key here...';
public function encrypt($data)
{
if (openssl_public_encrypt($data, $encrypted, $this->pubkey))
$data = base64_encode($encrypted);
else
throw new Exception('Unable to encrypt data. Perhaps it is bigger than the key size?');
return $data;
}
}
答案 0 :(得分:2)
我不会在应用程序级别上处理它。使用ssl
(HTTPS)的所有功能应该适合您。