# ContainerFileSystemCallbackContext.CreateCertificateFile

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ContainerFileSystemCallbackContext](/reference/api/go/aspire.hosting/containerfilesystemcallbackcontext.md)
- Version: `17.0.0`
- Kind: `method`

Creates a PEM container certificate file entry with the OpenSSL subject-hash symlink.

## Definition

```go
type ContainerFileSystemCallbackContext interface {
    // ... omitted for brevity
    CreateCertificateFile(
        name string,
        options ...*CreateCertificateFileOptions,
    ) ContainerFileSystemItem
}
```

## Signature

```go
CreateCertificateFile(
    name string,
    options ...*CreateCertificateFileOptions,
) ContainerFileSystemItem
```

## Parameters

- `name` (`string`) -- The simple file name (no path separators).
- `options` (`...*CreateCertificateFileOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*CreateCertificateFileOptions` argument.

- `Contents` (`*string`) -- The inline PEM-encoded contents of the certificate. Mutually exclusive with `sourcePath`.
- `SourcePath` (`*string`) -- An absolute path to a PEM file on the host to copy. Mutually exclusive with `contents`.
- `Owner` (`*float64`) -- The owner UID, or `null` to inherit.
- `Group` (`*float64`) -- The group GID, or `null` to inherit.
- `Mode` (`*float64`) -- The Unix file mode as an integer (for example `0o644`), or `null` to inherit.
- `ContinueOnError` (`*bool`) -- Whether to ignore errors creating this file.

## Returns

[`ContainerFileSystemItem`](/reference/api/go/aspire.hosting/containerfilesystemitem.md) -- The created certificate file entry.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [ContainerFileSystemCallbackContext](/reference/api/go/aspire.hosting/containerfilesystemcallbackcontext.md) -- `handle`
