src/main/java/com/hedera/hashgraph/identity/hcs/vc/HcsDocumentHashBase.java
/**
   * Constructs a credential hash that uniquely identifies this verifiable credential.
   * This is not a credential ID, but a hash composed of the properties included in HcsVcDocumentHashBase class
   * (excluding issuer name).
   * Credential hash is used to find the credential on Hedera VC registry.
   * Due to the nature of the VC document the hash taken from the base mandatory fields in this class
   * and shall produce a unique constant.
   * W3C specification defines ID field of a verifiable credential as not mandatory, however Hedera requires issuers to
   * define this property for each VC.
   *
   * @return The credential hash uniquely identifying this verifiable credential.
   */
Constructs a credential hash that uniquely identifies this verifiable credential.
This is not a credential ID, but a hash composed of the properties included in HcsVcDocumentHashBase class
(excluding issuer name).
Credential hash is used to find the credential on Hedera VC registry.
Due to the nature of the VC document the hash taken from the base mandatory fields in this class
and shall produce a unique constant.
W3C specification defines ID field of a verifiable credential as not mandatory, however Hedera requires issuers to
define this property for each VC.

@return The credential hash uniquely identifying this verifiable credential.
Constructs a credential hash that uniquely identifies this verifiable credential . This is not a credential ID but a hash composed of the properties included in HcsVcDocumentHashBase class ( excluding issuer name ) . Credential hash is used to find the credential on Hedera VC registry . Due to the nature of the VC document the hash taken from the base mandatory fields in this class and shall produce a unique constant . W3C specification defines ID field of a verifiable credential as not mandatory however Hedera requires issuers to define this property for each VC . @return The credential hash uniquely identifying this verifiable credential .
public final String toCredentialHash() {
    LinkedHashMap<String, Object> map = new LinkedHashMap<>();
    map.put(HcsVcDocumentJsonProperties.ID, this.id);
    map.put(HcsVcDocumentJsonProperties.TYPE, this.type);
    map.put(HcsVcDocumentJsonProperties.ISSUER, this.issuer.getId());
    map.put(HcsVcDocumentJsonProperties.ISSUANCE_DATE, this.issuanceDate);
    Map<String, Object> customHashableProperties = getCustomHashableFieldsHook();
    map.putAll(customHashableProperties);
    String json = JsonUtils.getGson().toJson(map);
    byte[] hash = Hashing.sha256().hashBytes(json.getBytes(StandardCharsets.UTF_8)).asBytes();
    return Base58.encode(hash);
  }
public final String toCredentialHash ( ) { LinkedHashMap < String , Object > map = new LinkedHashMap < > ( ) ; map . put ( HcsVcDocumentJsonProperties . ID , this . id ) ; map . put ( HcsVcDocumentJsonProperties . TYPE , this . type ) ; map . put ( HcsVcDocumentJsonProperties . ISSUER , this . issuer . getId ( ) ) ; map . put ( HcsVcDocumentJsonProperties . ISSUANCE_DATE , this . issuanceDate ) ; Map < String , Object > customHashableProperties = getCustomHashableFieldsHook ( ) ; map . putAll ( customHashableProperties ) ; String json = JsonUtils . getGson ( ) . toJson ( map ) ; byte [ ] hash = Hashing . sha256 ( ) . hashBytes ( json . getBytes ( StandardCharsets . UTF_8 ) ) . asBytes ( ) ; return Base58 . encode ( hash ) ; }
Constructs a credential hash that uniquely identifies this verifiable credential.
Constructs a credential hash that uniquely identifies this verifiable credential .