Share via


ConfidentialLedgerClient.GetEnclaveQuotes(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 Azure.Response GetEnclaveQuotes (Azure.RequestContext context = default);
abstract member GetEnclaveQuotes : Azure.RequestContext -> Azure.Response
override this.GetEnclaveQuotes : Azure.RequestContext -> Azure.Response
Public Overridable Function GetEnclaveQuotes (Optional context As RequestContext = Nothing) As 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 GetEnclaveQuotes and parse the result.

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

Response response = client.GetEnclaveQuotes();

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 GetEnclaveQuotes with all request content and parse the result.

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

Response response = client.GetEnclaveQuotes();

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