mirror of
https://gitee.com/BDWare/common
synced 2025-01-09 17:34:16 +00:00
remove sign and sign verify in Contract.java
This commit is contained in:
parent
b670a6586a
commit
3fb7b5c7c2
@ -51,7 +51,9 @@ dependencies {
|
||||
implementation 'org.bdware.doip:doip-audit-tool:1.1.2'
|
||||
}
|
||||
group = "org.bdware.sc"
|
||||
version = "1.6.5"
|
||||
|
||||
version = "1.6.6"
|
||||
|
||||
|
||||
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
package org.bdware.sc;
|
||||
|
||||
public class DoConfig {
|
||||
public static boolean callContractUsingDOI = true;
|
||||
}
|
@ -2,18 +2,13 @@ package org.bdware.sc.bean;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import org.bdware.sc.node.YjsType;
|
||||
import org.bouncycastle.crypto.CryptoException;
|
||||
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
|
||||
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
|
||||
import org.zz.gmhelper.SM2Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Contract extends SM2Verifiable implements Serializable {
|
||||
public class Contract implements Serializable {
|
||||
public String key;
|
||||
public ContractStartInfo startInfo = new ContractStartInfo();
|
||||
public int shardingId;
|
||||
@ -159,32 +154,14 @@ public class Contract extends SM2Verifiable implements Serializable {
|
||||
this.responseType = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPublicKey() {
|
||||
return pubkey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPublicKey(String pubkey) {
|
||||
this.pubkey = pubkey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentStr() {
|
||||
return type + "|" + script + "|" + owner;
|
||||
}
|
||||
|
||||
public String signResult(String result) {
|
||||
ECPrivateKeyParameters priKey =
|
||||
new ECPrivateKeyParameters(new BigInteger(key, 16), SM2Util.DOMAIN_PARAMS);
|
||||
try {
|
||||
return ByteUtils.toHexString(SM2Util.sign(priKey, result.getBytes()));
|
||||
} catch (CryptoException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean getStateful() {
|
||||
return stateful;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user