次の方法で共有


CodeTransparencyClient.GetDidConfigAsync Method

Definition

Overloads

GetDidConfigAsync(RequestContext)

[Protocol Method] Get the DID configuration file.

GetDidConfigAsync(CancellationToken)

Get the DID configuration file.

GetDidConfigAsync(RequestContext)

Source:
CodeTransparencyClient.cs

[Protocol Method] Get the DID configuration file.

public virtual System.Threading.Tasks.Task<Azure.Response> GetDidConfigAsync (Azure.RequestContext context);
abstract member GetDidConfigAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDidConfigAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDidConfigAsync (context As RequestContext) 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 GetDidConfigAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = await client.GetDidConfigAsync(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("controller").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("kty").ToString());

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

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = await client.GetDidConfigAsync(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("controller").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("alg").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("crv").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("d").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("dp").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("dq").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("e").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("k").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("kid").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("kty").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("n").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("p").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("q").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("qi").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("use").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("x").ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("x5c")[0].ToString());
Console.WriteLine(result.GetProperty("assertionMethod")[0].GetProperty("publicKeyJwk").GetProperty("y").ToString());

Applies to

GetDidConfigAsync(CancellationToken)

Source:
CodeTransparencyClient.cs

Get the DID configuration file.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.DidDocument>> GetDidConfigAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetDidConfigAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.DidDocument>>
override this.GetDidConfigAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.DidDocument>>
Public Overridable Function GetDidConfigAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DidDocument))

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetDidConfigAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<DidDocument> response = await client.GetDidConfigAsync();

This sample shows how to call GetDidConfigAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<DidDocument> response = await client.GetDidConfigAsync();

Applies to