|
@@ -228,14 +228,14 @@ class GmService
|
|
|
//SM2Encrypt
|
|
|
public static function SM2Encrypt($data, $pubkey)
|
|
|
{
|
|
|
- dump(1112131);
|
|
|
- exit;
|
|
|
//sm2加密
|
|
|
php_SM2Encrypt($data, $cipher, $pubkey);
|
|
|
//php_SM2Encrypt接口返回的密文值是c1c3c2格式,以下示例转DER编码
|
|
|
php_SM2FormatConvert(102, $cipher, $der);
|
|
|
//SM2加密字符串转base64编码
|
|
|
$sm2encrypted = base64_encode($der);
|
|
|
+ dump($sm2encrypted);
|
|
|
+ exit;
|
|
|
return $sm2encrypted;
|
|
|
}
|
|
|
|