# HttpsCertificateConfigurationCallbackAnnotationContext Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [HttpsCertificateConfigurationCallbackAnnotationContext](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext.md)
- Kind: `Properties`
- Members: `9`

Context provided to a [HttpsCertificateConfigurationCallbackAnnotation](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotation.md) callback.

## Arguments

- Name: `Arguments`
- Modifiers: `get; init`
- Returns: `List<object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

Gets the command line arguments associated with the callback context. Values can be either a string or a path value provider such as [HttpsCertificateConfigurationCallbackAnnotationContext.CertificatePath](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext/properties.md#certificatepath) or [HttpsCertificateConfigurationCallbackAnnotationContext.KeyPath](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext/properties.md#keypath).

```csharp
public List<object> Arguments { get; init; }
```

## Remarks

```csharp
builder.AddContainer("my-resource", "my-image:latest")
   .WithHttpsCertificateConfiguration(ctx =>
   {
       ctx.Arguments.Add("--certificate");
       ctx.Arguments.Add(ctx.CertificatePath);
       ctx.Arguments.Add("--key");
       ctx.Arguments.Add(ctx.KeyPath);
       return Task.CompletedTask;
   });
```

## CancellationToken

- Name: `CancellationToken`
- Modifiers: `get; init`
- Returns: `CancellationToken`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

Gets the [HttpsCertificateConfigurationCallbackAnnotationContext.CancellationToken](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext/properties.md#cancellationtoken) that can be used to cancel the operation.

```csharp
public CancellationToken CancellationToken { get; init; }
```

## CertificatePath

- Name: `CertificatePath`
- Modifiers: `get; init`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

A value provider that will resolve to a path to the certificate file.

```csharp
public ReferenceExpression CertificatePath { get; init; }
```

## EnvironmentVariables

- Name: `EnvironmentVariables`
- Modifiers: `get; init`
- Returns: `Dictionary<string, object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

Gets the environment variables required to configure a certificate key pair for the resource. The dictionary key is the environment variable name; the value can be either a string or a path value provider such as [HttpsCertificateConfigurationCallbackAnnotationContext.CertificatePath](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext/properties.md#certificatepath) or [HttpsCertificateConfigurationCallbackAnnotationContext.KeyPath](/reference/api/csharp/aspire.hosting/httpscertificateconfigurationcallbackannotationcontext/properties.md#keypath).

```csharp
public Dictionary<string, object> EnvironmentVariables { get; init; }
```

## Remarks

```csharp
builder.AddContainer("my-resource", "my-image:latest")
    .WithHttpsCertificateConfiguration(ctx =>
    {
        ctx.EnvironmentVariables["Kestrel__Certificates__Path"] = ctx.CertificatePath;
        ctx.EnvironmentVariables["Kestrel__Certificates__KeyPath"] = ctx.KeyPath;
        return Task.CompletedTask;
    });
```

## ExecutionContext

- Name: `ExecutionContext`
- Modifiers: `get; init`
- Returns: [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

Gets the [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) for this session.

```csharp
public DistributedApplicationExecutionContext ExecutionContext { get; init; }
```

## KeyPath

- Name: `KeyPath`
- Modifiers: `get; init`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

A value provider that will resolve to a path to the private key for the certificate.

```csharp
public ReferenceExpression KeyPath { get; init; }
```

## Password

- Name: `Password`
- Modifiers: `nullable` `get; init`
- Returns: [IValueProvider?](/reference/api/csharp/aspire.hosting/ivalueprovider.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

A value provider that will resolve to the password for the private key, if applicable.

```csharp
public IValueProvider? Password { get; init; }
```

## PfxPath

- Name: `PfxPath`
- Modifiers: `get; init`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

A value provider that will resolve to a path to a PFX file for the key pair.

```csharp
public ReferenceExpression PfxPath { get; init; }
```

## Resource

- Name: `Resource`
- Modifiers: `get; init`
- Returns: [IResource](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HttpsCertificateConfigurationCallbackAnnotaion.cs)

Gets the resource to which the annotation is applied.

```csharp
public IResource Resource { get; init; }
```
