# CertificateTrustConfigurationCallbackAnnotationContext

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

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

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class CertificateTrustConfigurationCallbackAnnotationContext
{
    // ...
}
```

## Constructors

- [CertificateTrustConfigurationCallbackAnnotationContext](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/constructors.md#constructor)

## Properties

- [Arguments](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#arguments) : `List<object>` `get; init` -- Gets the command line arguments associated with the callback context. Values can be either a string or a path value provider such as [CertificateTrustConfigurationCallbackAnnotationContext.CertificateBundlePath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatebundlepath) or [CertificateTrustConfigurationCallbackAnnotationContext.CertificateDirectoriesPath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatedirectoriespath).
- [CancellationToken](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#cancellationtoken) : `CancellationToken` `get; init` -- Gets the [CertificateTrustConfigurationCallbackAnnotationContext.CancellationToken](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#cancellationtoken) that can be used to cancel the operation.
- [CertificateBundlePath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatebundlepath) : [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) `get; init` -- A value provider that will resolve to a path to a custom certificate bundle.
- [CertificateDirectoriesPath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatedirectoriespath) : [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) `get; init` -- A value provider that will resolve to paths containing individual certificates.
- [EnvironmentVariables](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#environmentvariables) : `Dictionary<string, object>` `get; init` -- Gets the environment variables required to configure certificate trust 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 [CertificateTrustConfigurationCallbackAnnotationContext.CertificateBundlePath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatebundlepath) or [CertificateTrustConfigurationCallbackAnnotationContext.CertificateDirectoriesPath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatedirectoriespath). By default the environment will always include an entry for `SSL_CERT_DIR` and may include `SSL_CERT_FILE` if [CertificateTrustScope.Override](/reference/api/csharp/aspire.hosting/certificatetrustscope/fields.md) or [CertificateTrustScope.System](/reference/api/csharp/aspire.hosting/certificatetrustscope/fields.md) is configured.
- [ExecutionContext](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#executioncontext) : [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) `get; init` -- Gets the [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) for this session.
- [Resource](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get; init` -- Gets the resource to which the annotation is applied.
- [Scope](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#scope) : [CertificateTrustScope](/reference/api/csharp/aspire.hosting/certificatetrustscope.md) `get; init` -- Gets the [CertificateTrustScope](/reference/api/csharp/aspire.hosting/certificatetrustscope.md) for the resource.

## Methods

- [CreateCustomBundle(Func<X509Certificate2Collection, CancellationToken, Task<byte[]>>)](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/methods.md#createcustombundle-func-x509certificate2collection-cancellationtoken-task-byte) : [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) `experimental` -- Adds a custom certificate bundle to the callback context. The provided generator will be invoked during trust configuration and should return the bundle contents as a byte array.
