你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ConfidentialLedgerClient.GetEnclaveQuotes(RequestContext) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
[协议方法]获取机密账本的所有节点的引号。
- 此 协议方法 允许显式创建请求并处理高级方案的响应。
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
参数
- context
- RequestContext
请求上下文,可以基于每个调用替代客户端管道的默认行为。
返回
从服务返回的响应。
例外
服务返回了非成功状态代码。
示例
此示例演示如何调用 GetEnclaveQuotes 并分析结果。
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConfidentialLedgerClient(endpoint, credential);
Response response = client.GetEnclaveQuotes();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("currentNodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<test>").GetProperty("nodeId").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<test>").GetProperty("mrenclave").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<test>").GetProperty("quoteVersion").ToString());
Console.WriteLine(result.GetProperty("enclaveQuotes").GetProperty("<test>").GetProperty("raw").ToString());
注解
引号是 SGX enclave 度量值,可用于验证节点及其 enclave 的有效性。
下面是响应有效负载的 JSON 架构。
响应正文:
的 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.
}