examples/appnet-api-server/src/main/java/com/hedera/hashgraph/identity/hcs/example/appnet/handlers/DemoHandler.java
/**
   * Calculates a credential hash for the given credential document.
   * Resulting hash is written directly into the response body as raw text.
   *
   * @param ctx The HTTP context.
   */
Calculates a credential hash for the given credential document.
Resulting hash is written directly into the response body as raw text.

@param ctx The HTTP context.
Calculates a credential hash for the given credential document . Resulting hash is written directly into the response body as raw text . @param ctx The HTTP context .
public void determineCredentialHash(final Context ctx) {
    ctx.getRequest().getBody().then(data -> {
      try {
        String hash = HcsVcDocumentBase.fromJson(data.getText(), DrivingLicenseDocument.class, DrivingLicense.class).toCredentialHash();
        ctx.render(hash);
      } catch (Exception e) {
        ctx.getResponse().status(Status.BAD_REQUEST);
        ctx.render(Jackson.json(new ErrorResponse("Invalid verifiable credential document received.")));
      }
    });
  }
public void determineCredentialHash ( final Context ctx ) { ctx . getRequest ( ) . getBody ( ) . then ( data -> { try { String hash = HcsVcDocumentBase . fromJson ( data . getText ( ) , DrivingLicenseDocument . class , DrivingLicense . class ) . toCredentialHash ( ) ; ctx . render ( hash ) ; } catch ( Exception e ) { ctx . getResponse ( ) . status ( Status . BAD_REQUEST ) ; ctx . render ( Jackson . json ( new ErrorResponse ( "Invalid verifiable credential document received." ) ) ) ; } } ) ; }
Calculates a credential hash for the given credential document.
Calculates a credential hash for the given credential document .