Share via


CodeTransparencyClient.GetDidConfig Method

Definition

Overloads

GetDidConfig(RequestContext)

[Protocol Method] Get the DID configuration file.

GetDidConfig(CancellationToken)

Get the DID configuration file.

GetDidConfig(RequestContext)

Source:
CodeTransparencyClient.cs

[Protocol Method] Get the DID configuration file.

public virtual Azure.Response GetDidConfig (Azure.RequestContext context);
abstract member GetDidConfig : Azure.RequestContext -> Azure.Response
override this.GetDidConfig : Azure.RequestContext -> Azure.Response
Public Overridable Function GetDidConfig (context As RequestContext) 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 GetDidConfig 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 = client.GetDidConfig(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 GetDidConfig 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 = client.GetDidConfig(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

GetDidConfig(CancellationToken)

Source:
CodeTransparencyClient.cs

Get the DID configuration file.

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

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetDidConfig.

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

Response<DidDocument> response = client.GetDidConfig();

This sample shows how to call GetDidConfig 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 = client.GetDidConfig();

Applies to