CodeTransparencyClient.GetPublicKeysAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetPublicKeysAsync(CancellationToken) |
Get the public keys used by the service to verify receipts, normalized to a key set. |
| GetPublicKeysAsync(RequestContext) |
Get the public keys used by the service to verify receipts. |
GetPublicKeysAsync(CancellationToken)
- Source:
- CodeTransparencyClient.cs
- Source:
- CodeTransparencyClient.cs
Get the public keys used by the service to verify receipts, normalized to a key set.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyVerificationKeySet>> GetPublicKeysAsync(System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.JwksDocument>> GetPublicKeysAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member GetPublicKeysAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyVerificationKeySet>>
override this.GetPublicKeysAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyVerificationKeySet>>
abstract member GetPublicKeysAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.JwksDocument>>
override this.GetPublicKeysAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.JwksDocument>>
Public Overridable Function GetPublicKeysAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of CodeTransparencyVerificationKeySet))
Public Overridable Function GetPublicKeysAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of JwksDocument))
Parameters
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetPublicKeysAsync.
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);
Response<JwksDocument> response = await client.GetPublicKeysAsync();
Applies to
GetPublicKeysAsync(RequestContext)
- Source:
- CodeTransparencyClient.cs
- Source:
- CodeTransparencyClient.cs
Get the public keys used by the service to verify receipts.
public virtual System.Threading.Tasks.Task<Azure.Response> GetPublicKeysAsync(Azure.RequestContext context);
abstract member GetPublicKeysAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetPublicKeysAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetPublicKeysAsync (context As RequestContext) As Task(Of Response)
Parameters
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The raw JWK Set JSON response returned from the service.
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetPublicKeysAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);
Response response = await client.GetPublicKeysAsync(null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("keys")[0].GetProperty("kty").ToString());