Share via


ConfidentialLedgerClient.GetEnclaveQuotesAsync(RequestContext) Method

Definition

[Protocol Method] Gets quotes for all nodes of the Confidential Ledger.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> GetEnclaveQuotesAsync (Azure.RequestContext context = default);
abstract member GetEnclaveQuotesAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetEnclaveQuotesAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetEnclaveQuotesAsync (Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetEnclaveQuotesAsync and parse the result.

TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);

Response response = await client.GetEnclaveQuotesAsync();

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("currentNodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("nodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("quoteVersion").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("raw").ToString());

This sample shows how to call GetEnclaveQuotesAsync with all request content and parse the result.

TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);

Response response = await client.GetEnclaveQuotesAsync();

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("currentNodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("nodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("mrenclave").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("quoteVersion").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<key>").GetProperty("raw").ToString());

Remarks

A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.

Below is the JSON schema for the response payload.

Response Body:

Schema for ConfidentialLedgerEnclaves:

{
  currentNodeId: string, # Required. Id of the Confidential Ledger node responding to the request.
  enclaveQuotes: Dictionary<string, EnclaveQuote>, # Required. Dictionary of enclave quotes, indexed by node id.
}

Applies to