identity & identity基础功能测试

This commit is contained in:
ghy committed 2021-03-10 15:43:03 +08:00
1 parent 01ed6a2e56
commit 16416fecf4
4 files changed
+265 -22

No files matched your search

@@ -38,15 +38,7 @@ public class SM2PrivateKey implements PrivateKeyInterface {
* @date 2021/3/7
**/
public SM2PrivateKey(byte[] d) {
if(d.length == 32 || d.length == 33)
privateKey = new ECPrivateKeyParameters(new BigInteger(d), SM2Base.DOMAIN_PARAMS);
else {
try {
throw new SM2Exception("SM2私钥中,参数d长度应为32/33");
} catch (SM2Exception e) {
e.printStackTrace();
}
}
privateKey = new ECPrivateKeyParameters(new BigInteger(d), SM2Base.DOMAIN_PARAMS);
}
public SM2PrivateKey(byte[] d, ECDomainParameters parameters){
if(d.length == 32 || d.length == 33)