ConfidentialLedgerCertificateClient.GetLedgerIdentityAsync Method

Definition

[Protocol Method] Gets identity information for a Confidential Ledger instance.

  • 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> GetLedgerIdentityAsync (string ledgerId, Azure.RequestContext context = default);
abstract member GetLedgerIdentityAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLedgerIdentityAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLedgerIdentityAsync (ledgerId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

ledgerId
String

Id of the Confidential Ledger instance to get information for.

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

ledgerId is null.

ledgerId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

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

ConfidentialLedgerCertificateClient client = new ConfidentialLedgerCertificateClient(new Uri("http://localhost:3000"));

Response response = await client.GetLedgerIdentityAsync("<ledgerId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("ledgerTlsCertificate").ToString());

This sample shows how to call GetLedgerIdentityAsync with all parameters and parse the result.

ConfidentialLedgerCertificateClient client = new ConfidentialLedgerCertificateClient(new Uri("http://localhost:3000"));

Response response = await client.GetLedgerIdentityAsync("<ledgerId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("ledgerId").ToString());
Console.WriteLine(result.GetProperty("ledgerTlsCertificate").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for LedgerIdentityInformation:

{
  ledgerId: string, # Optional. Id for the ledger.
  ledgerTlsCertificate: string, # Required. PEM-encoded certificate used for TLS by the Confidential Ledger.
}

Applies to