Stars: 226
Forks: 74
Pull Requests: 2
Issues: 59
Watchers: 7
Last Updated: 2023-08-09 04:36:46
php版本,支持国密SM2的签名算法,非对称加解密,SM3的hash, SM4的对称加解密
License:
Languages: PHP
function __construct($formatSign='hex', $randFixed = true) {
// 注意: 这个randFixed尽量取false, 如需要固定,请重新生成$foreignkey密码对
$this->adapter = RtEccFactory::getAdapter();
$this->generator = RtEccFactory::getSmCurves()->generatorSm2();
if(in_array($formatSign,$this->arrFormat)){
$this->formatSign = $formatSign;
} else {
$this->formatSign = 'hex';
}
if(!$randFixed){
$this->useDerandomizedSignatures = false;
$this->useDerandomizedEncrypt = false;
}
}