| Input |
| OutputResource or None |
| 1: Generate an access token with the owner’s signature. |
| 2: Long timeStamp = ; |
| 3: String data = accountId + timeStamp + PublicKey; |
| 4: Get ECDSA signature result sigdata = SignWithSecp256k1(data); |
| 5: The user sends the signed token to the server. |
| 6: Resource server queries the owner’s information on the blockchain. |
| 7: = - |
| 8: then |
| 9: Query the owner’s information on the blockchain. |
| 10: = |
| 11: = |
| 12: ifthen |
| 13: String tmpPublicKey = result.getValue2(); |
| 14: String resourceData = result.getValue3(); |
| 15: String tmpsigdata = result.getValue4(); |
| 16: Verify the validity of the access token |
| 17: iftmpPublicKey.equals(PublicKey) then |
| 18: Get cryptographic suite cryptoSuite = new CryptoSuite(CryptoType.ECDSATYPE); |
| 19: hashData = cryptoSuite.hash(dataToBeSigned); |
| 20: Boolean nVerification = cryptoSuite.verify (hashData, sigdata); |
| 21: String tmpdataToBeVrified = accountId + UserInfo + tmpPublicKey; |
| 22: String hashData = cryptoSuite.hash(tmpdataToBeVrified); |
| 23: Boolean nVerification = cryptoSuite.verify(hashData); |
| 24: ifnVerification == Truethen |
| 25: Verify the validity of the resource data |
| 26: String tmpdataToBeVrified = resourceData + accountId + tmpPublicKey; |
| 27: hashData = cryptoSuite.hash(tmpdataToBeVrified); |
| 28: nVerification = cryptoSuite.verify(hashData); |
| 29: ifnVerification == Truethen |
| 30: returnResource |
| 31: end if |
| 32: end if |
| 33: end if |
| 34: end if |
| 35: end if |
| 36: returnNone |