|
@@ -225,18 +225,10 @@ class GmService
|
|
|
{
|
|
|
//sm2加密
|
|
|
$recode = php_SM2Encrypt($data, $cipher, $pubkey);
|
|
|
-
|
|
|
- echo "<br/>recode:$recode \n";
|
|
|
-
|
|
|
//php_SM2Encrypt接口返回的密文值是c1c3c2格式,以下示例转DER编码
|
|
|
$recode = php_SM2FormatConvert(102, $cipher, $der);
|
|
|
- echo "<br/>recode:$recode \n";
|
|
|
-
|
|
|
//SM2加密字符串转base64编码
|
|
|
$sm2encrypted = base64_encode($der);
|
|
|
-
|
|
|
- echo "<br/>sm2加密字符串base64:$sm2encrypted \n";
|
|
|
-
|
|
|
return $sm2encrypted;
|
|
|
}
|
|
|
|