Resolve the Declared Credential
Resolve Credential is different from Resolve DID. Resolve DID only needs to provide the specified DID to get the latest content on the chain, where the Resolve Credential may have different results depending on whether issuer is provided or not. The specific situation analysis is as follows:
The credential has not been operated. Whether the request has the issuer parameter or not, the status of non-existence is returned, and the result does not contain any transaction.
The credential has only been declared. Whether the request has the issuer parameter or not, the declared status is returned, and the result contains a declared transaction.
The credential has been declared and revoked by the owner or issuer of the credential. Whether the request has the issuer parameter or not, the revoked status is returned. The result includes two transactions, one is the declared transaction, and the other is the valid transaction revoked by the owner or issuer.
The credential is undeclared and revoked by the owner. Whether the request has the issuer parameter or not, the revoked status is returned, and the result contains a valid transaction revoked by the owner.
The credential is undeclared and revoked by the issuer. If the request has the issuer parameter, the revoked status will be returned, and the result contains a valid transaction revoked by the issuer. If the request has no issuer parameter, it will return the non-existent status, and the result will not contain any transactions.
Example
Usage
The SDK provides a method to resolve the credential, where only the declared credential can be resolved.
id the credential ID that needs to be resolved; status indicates the status of Credential. If the interface returns NULL, you can get whether there is an error or credential has not been declared by status; force indicates that credentials can be obtained from the chain or from the cache within the effective period.
This method is used to check whether Credential has been revoked by the specified DID. Generally, it's used to inquire whether there is a valid transaction revoked by the issuer with the third-party KYC credential.
This method is used to resolve all the transaction contents of the credential, and the returned CredentialBiography object. issuer is the issuer of the credential, which can be NULL. If no issuer is provided, the transaction of issuer revoke will be ignored. CredentialBiography provides methods to obtain the status of credentials on the chain, the number of transactions, the specific transaction content, etc. Refer to API documentation for specific methods.
The CredentialBiography needs to be destroyed after being used.
Last updated