Elastos ID chain supports Credential cochain, which is used for DID credential information that needs to be publicly declared. Whether the credential has been declared or not, it can be revoked so as to publicly inform that the credential is invalid and can no longer be trusted.
Credential provides a method to publish the current credential to the chain (i.e. declare it). It should be noted here that credentials that have not been declared or revoked by the owner or issuer can be declared. There is only one declaration for one credential, and the declaration can only be initiated by the owner of Verifiable Credential.
signkey s the key of the declarant, that is, the owner of the Verifiable Credential, which is used to sign the published content of the declared credential. If signkey == NULL, the owner’s Default Key is used by default; storepass is the store pass of the DID Store where the private key used by the declarant is signed.
return value = -1, if error occurs;
return value = 0, declare credential failed;
return value = 1, declare credential successfully.
Credential provides a method to revoke credentials. It should be noted here that a credential can be revoked whether it has been declared or not, but if it has been revoked by the owner or issuer, it cannot be revoked again. Revocation of Verifiable Credential needs to be realized by the transaction initiated by the owner or the issuer.
signkey is the key of the revoker, that is, the owner or issuer of Verifiable Credential. If signkey == NULL, the Default Key of the owner will be used by default.