diff --git a/CHANGELOG.md b/CHANGELOG.md index abb155756..241b1d3e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### V1.8.6 (2022-10-14) +Features: +1. Upgrade the property fields in WeIdDocument to conform to the W3C DID Specification +2. Upgrade the way data is stored and retrieved in the weid-contract +3. Upgrade the interfaces related to WeId and Evidence + ### V1.8.5 (2022-08-16) Features: 1. Replace the web3sdk with fisco-bcos-java-sdk diff --git a/VERSION b/VERSION index 40e8402a2..085e214b8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.6-rc.2-SNAPSHOT \ No newline at end of file +1.8.6-rc1 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5082a8718..0440ec22f 100644 --- a/build.gradle +++ b/build.gradle @@ -173,8 +173,8 @@ dependencies { localDeps 'org.projectlombok:lombok:1.18.10' if (!gradle.startParameter.isOffline()) { compile logger, lombok, apache_commons, json, mysql_driver, redisson, zxing, rpc, pdfbox, protobuf, caffeine, oval, gson - compile("com.webank:weid-contract-java:1.3.1-rc.2-SNAPSHOT") - //compile("com.webank:weid-contract-java:1.3.0-rc1") + //compile("com.webank:weid-contract-java:1.3.1-rc.2-SNAPSHOT") + compile("com.webank:weid-contract-java:1.3.1-rc1") compile fileTree(dir: 'lib', include: '*.jar') implementation 'com.google.guava:guava:31.1-jre' diff --git a/gradle.properties b/gradle.properties index 9f36acf0f..8a87e055e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8' jdkTlsNamedGroups=secp256r1,secp256k1 -repoType=cn +repoType=en signing.keyId= signing.password= signing.secretKeyRingFile= diff --git a/src/main/java/com/webank/weid/protocol/base/PublicKeyProperty.java b/src/main/java/com/webank/weid/protocol/base/PublicKeyProperty.java deleted file mode 100644 index c819bcf43..000000000 --- a/src/main/java/com/webank/weid/protocol/base/PublicKeyProperty.java +++ /dev/null @@ -1,39 +0,0 @@ - - -package com.webank.weid.protocol.base; - -import lombok.Data; - -/** - * The base data structure for public key properties. - * - * @author tonychen 2018.10.8 - */ -@Data -public class PublicKeyProperty { - - /** - * Required: The id. - */ - private String id; - - /** - * Required: The type. - */ - private String type; - - /** - * Required: The owner. - */ - private String owner; - - /** - * Required: The public key. - */ - private String publicKey; - - /** - * Required: Revoked or not. - */ - private Boolean revoked = false; -} diff --git a/src/main/java/com/webank/weid/protocol/base/WeIdDocument.java b/src/main/java/com/webank/weid/protocol/base/WeIdDocument.java index 570e68c49..a1ffc61ef 100644 --- a/src/main/java/com/webank/weid/protocol/base/WeIdDocument.java +++ b/src/main/java/com/webank/weid/protocol/base/WeIdDocument.java @@ -19,7 +19,7 @@ /** * The base data structure to handle WeIdentity DID Document info. * - * @author tonychen 2018.9.29 + * @author afeexian 2022.8.29 */ @Data public class WeIdDocument implements JsonSerializer { diff --git a/src/main/java/com/webank/weid/service/impl/CptServiceImpl.java b/src/main/java/com/webank/weid/service/impl/CptServiceImpl.java index 9abe06d46..8a97e0732 100644 --- a/src/main/java/com/webank/weid/service/impl/CptServiceImpl.java +++ b/src/main/java/com/webank/weid/service/impl/CptServiceImpl.java @@ -31,7 +31,7 @@ /** * Service implementation for operation on CPT (Claim Protocol Type). * - * @author lingfenghe + * @author afeexian */ public class CptServiceImpl extends AbstractService implements CptService { diff --git a/src/main/java/com/webank/weid/service/impl/EvidenceServiceImpl.java b/src/main/java/com/webank/weid/service/impl/EvidenceServiceImpl.java index 71cfde02a..747d90531 100644 --- a/src/main/java/com/webank/weid/service/impl/EvidenceServiceImpl.java +++ b/src/main/java/com/webank/weid/service/impl/EvidenceServiceImpl.java @@ -41,7 +41,7 @@ /** * Service implementations for operations on Evidence. * - * @author chaoxinhu 2019.1 + * @author afeexian 2022.10 */ public class EvidenceServiceImpl extends AbstractService implements EvidenceService { diff --git a/src/main/java/com/webank/weid/service/impl/WeIdServiceImpl.java b/src/main/java/com/webank/weid/service/impl/WeIdServiceImpl.java index a418acf56..0326bd890 100644 --- a/src/main/java/com/webank/weid/service/impl/WeIdServiceImpl.java +++ b/src/main/java/com/webank/weid/service/impl/WeIdServiceImpl.java @@ -37,7 +37,7 @@ /** * Service implementations for operations on WeIdentity DID. * - * @author tonychen 2018.10 + * @author afeexian 2022.08 */ public class WeIdServiceImpl extends AbstractService implements WeIdService { diff --git a/src/main/java/com/webank/weid/service/impl/engine/fiscov2/EvidenceServiceEngineV2.java b/src/main/java/com/webank/weid/service/impl/engine/fiscov2/EvidenceServiceEngineV2.java index fb9d7047a..dc96cbba2 100644 --- a/src/main/java/com/webank/weid/service/impl/engine/fiscov2/EvidenceServiceEngineV2.java +++ b/src/main/java/com/webank/weid/service/impl/engine/fiscov2/EvidenceServiceEngineV2.java @@ -48,7 +48,7 @@ /** * EvidenceServiceEngine calls evidence contract which runs on FISCO BCOS 2.0. * - * @author yanggang, chaoxinhu + * @author afeexian, marsli */ public class EvidenceServiceEngineV2 extends BaseEngine implements EvidenceServiceEngine { diff --git a/src/main/java/com/webank/weid/service/impl/engine/fiscov2/WeIdServiceEngineV2.java b/src/main/java/com/webank/weid/service/impl/engine/fiscov2/WeIdServiceEngineV2.java index bdbd19b36..d6ed61d88 100644 --- a/src/main/java/com/webank/weid/service/impl/engine/fiscov2/WeIdServiceEngineV2.java +++ b/src/main/java/com/webank/weid/service/impl/engine/fiscov2/WeIdServiceEngineV2.java @@ -29,7 +29,7 @@ /** * WeIdServiceEngine call weid contract which runs on FISCO BCOS 2.0. * - * @author tonychen 2019年6月21日 + * @author afeexian, marsli 2022.10.10 */ public class WeIdServiceEngineV2 extends BaseEngine implements WeIdServiceEngine { @@ -157,7 +157,7 @@ public ResponseData createWeId( String privateKey) { AuthenticationProperty authenticationProperty = new AuthenticationProperty(); - //在创建weid时默认添加一个id为#keys-0的verification method + //在创建weid时默认添加一个id为#keys-[hash(publicKey)]的verification method authenticationProperty.setId(WeIdUtils.convertAddressToWeId(weAddress) + "#keys-" + DataToolUtils.hash(publicKey).substring(58)); //verification method controller默认为自己 authenticationProperty.setController(WeIdUtils.convertAddressToWeId(weAddress)); diff --git a/src/main/java/com/webank/weid/util/DataToolUtils.java b/src/main/java/com/webank/weid/util/DataToolUtils.java index 1bac5c01f..ff4d0df0a 100644 --- a/src/main/java/com/webank/weid/util/DataToolUtils.java +++ b/src/main/java/com/webank/weid/util/DataToolUtils.java @@ -27,7 +27,6 @@ import com.webank.weid.exception.DataTypeCastException; import com.webank.weid.exception.WeIdBaseException; import com.webank.weid.protocol.base.AuthenticationProperty; -import com.webank.weid.protocol.base.PublicKeyProperty; import com.webank.weid.protocol.base.WeIdDocument; import com.webank.weid.protocol.cpt.RawCptSchema; import com.webank.weid.protocol.request.CptMapArgs; @@ -623,7 +622,7 @@ public static String SigBase64Serialization( * @param signature signature base64 string * @return secp256k1 signature (v = 0,1) */ - public static RsvSignature SigBase64Deserialization(String signature) { + public static RsvSignature SigBase64Deserialization(String signature) { byte[] sigBytes = base64Decode(signature.getBytes(StandardCharsets.UTF_8)); if (SERIALIZED_SIGNATUREDATA_LENGTH != sigBytes.length) { throw new WeIdBaseException("signature data illegal"); @@ -765,19 +764,19 @@ public static boolean verifySignature( }*/ /** - * eecrypt the data. todo + * encrypt the data. todo * * @param data the data to encrypt * @param publicKey public key * @return decrypt data * @throws Exception encrypt exception */ - public static byte[] encrypt(String data, String publicKey) - throws Exception { -// -// cryptoSuite. -// ECCEncrypt encrypt = new ECCEncrypt(new BigInteger(publicKey)); -// return encrypt.encrypt(data.getBytes());*/ + public static byte[] encrypt(String data, String publicKey) throws Exception { + /* + cryptoSuite.ECCEncrypt encrypt = new ECCEncrypt(new BigInteger(publicKey)); + return encrypt.encrypt(data.getBytes()); + + */ return data.getBytes(); } diff --git a/src/main/resources/fisco.properties b/src/main/resources/fisco.properties index 3c32df1f1..69bca493b 100644 --- a/src/main/resources/fisco.properties +++ b/src/main/resources/fisco.properties @@ -54,7 +54,7 @@ group.id=1 # # ####################################################################################################### # Fisco-Bcos sdk SSL encrypt type, false:ECDSA, true:SM2 -sdk.sm-crypto=true +sdk.sm-crypto=false # fisco-bcos sdk cert path contains[ca.crt,sdk.crt,sdk.key] # if sdk.sm-crypto is true, contains [gm] directory, and gm dir contains [gmca.crt,gmsdk.crt,gmsdk.key,gmensdk.crt,gmensdk.key] sdk.cert-path=conf diff --git a/src/main/resources/weidentity.properties b/src/main/resources/weidentity.properties index d3afed75f..9aeaf63f9 100644 --- a/src/main/resources/weidentity.properties +++ b/src/main/resources/weidentity.properties @@ -13,7 +13,7 @@ amop.request.timeout=5000 amop.id=org44amop # Blockchain node info. -nodes=10.107.120.121:23200 +nodes=10.107.120.121:21200 #######################################################################################################