---
product: Chilkat
product_version: 11.7.0
language: asp
language_label: Classic ASP
class: Secrets
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/asp_SecretsRef.html
---
# Chilkat Secrets — Classic ASP — v11.7.0

> Chilkat 11.7.0 · language=asp · class=Secrets
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Secrets.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/asp/guide.md`.

## Purpose

**Manage application secrets through one consistent API.**

`Chilkat.Secrets` provides a unified interface for storing, retrieving, listing, and deleting secrets across local, cloud-based, and in-memory secret stores. It supports string, binary, and JSON secrets, making it useful for passwords, API keys, OAuth credentials, tokens, unlock codes, certificates, and private configuration data.

**Local secure storage**

- Windows Credential Manager
- Apple Keychain

**Cloud secret managers**

- AWS Secrets Manager
- Azure Key Vault
- IBM Cloud Secrets Manager
- Oracle Cloud Secrets
- Doppler Secrets

**Temporary secrets**

Use in-memory secrets when values should exist only for the lifetime of the running process.

**Flexible content types**

Store and retrieve secrets as strings, binary data, or structured JSON.

**Note:** Cloud-based secret managers often require local bootstrap credentials. These can be stored securely in the Windows Credential Manager or Apple Keychain and then used to authenticate to the cloud secret manager.

Start with the [Conceptual Overview](https://www.chilkatsoft.com/chilkat_secrets_api.asp) and [Components of a Secret Name](https://www.chilkatsoft.com/components_of_a_secret_name.asp). For an extended overview, see the [Secrets Class Overview](https://www.chilkatsoft.com/secrets_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```visual-basic
set secrets = Server.CreateObject("Chilkat.Secrets")

' ... use secrets ...

set secrets = Nothing
```

Classic ASP creates Chilkat objects with `Server.CreateObject`. The registered Chilkat ActiveX must match the bitness of the IIS application pool: a pool with *Enable 32-Bit Applications* set to True needs the 32-bit ActiveX, otherwise the 64-bit ActiveX. To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `Server.CreateObject("Chilkat.Secrets.11")` for Chilkat v11.\*.\*.

VBScript requires `set` when assigning an object, so the signatures on this page show `set x = obj.Method(...)` for methods that return a Chilkat object; test the result with `Is Nothing`, since a method that fails to return an object returns `Nothing`. A method with no return value is called as a statement without parentheses (`obj.Method arg1, arg2`). Boolean properties, arguments and return values are integers in the ActiveX: pass `1` or `0`, and test success with `= 1`. Byte arrays are Variant arrays and can be sent with `Response.BinaryWrite`. Asynchronous (*\*Async*) methods and event callbacks are not used from Classic ASP.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Classic ASP.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `secrets.DebugLogFilePath ' String` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastBinaryResult` | `secrets.LastBinaryResult ' Variant (read-only)` | read-only | This property is mainly used in SQL Server stored procedures to retrieve binary data from the last method call that returned binary data. |
| `LastErrorHtml` | `secrets.LastErrorHtml ' String (read-only)` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `secrets.LastErrorText ' String (read-only)` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `secrets.LastErrorXml ' String (read-only)` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `secrets.LastMethodSuccess ' Long` | read/write | Indicates the success or failure of the most recent method call: `1` means success, `0` means failure. |
| `LastStringResult` | `secrets.LastStringResult ' String (read-only)` | read-only | In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. |
| `LastStringResultLen` | `secrets.LastStringResultLen ' Long (read-only)` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `secrets.VerboseLogging ' Long` | read/write | If set to `1`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `secrets.Version ' String (read-only)` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `AutoSplit` | property, read/write | `secrets.AutoSplit ' Long` |
| `Compression` | property, read/write | `secrets.Compression ' Long` |
| `Location` | property, read/write | `secrets.Location ' String` |
| `UncommonOptions` | property, read/write | `secrets.UncommonOptions ' String` |
| `DeleteSecret` | method | `success = secrets.DeleteSecret(jsonId) ' Long (1/0)` |
| `GetSecretBd` | method | `success = secrets.GetSecretBd(jsonId, bd) ' Long (1/0)` |
| `GetSecretJson` | method | `success = secrets.GetSecretJson(jsonId, jsonOut) ' Long (1/0)` |
| `GetSecretSb` | method | `success = secrets.GetSecretSb(jsonId, sb) ' Long (1/0)` |
| `GetSecretStr` | method | `str = secrets.GetSecretStr(jsonId) ' String` |
| `ListSecrets` | method | `success = secrets.ListSecrets(json, jsonOut) ' Long (1/0)` |
| `SecretSpecToJson` | method | `success = secrets.SecretSpecToJson(secretSpec, json) ' Long (1/0)` |
| `SetBootstrapSecret` | method | `success = secrets.SetBootstrapSecret(jsonId, secretContent) ' Long (1/0)` |
| `UpdateSecretBd` | method | `success = secrets.UpdateSecretBd(jsonId, secret) ' Long (1/0)` |
| `UpdateSecretJson` | method | `success = secrets.UpdateSecretJson(jsonId, secret) ' Long (1/0)` |
| `UpdateSecretSb` | method | `success = secrets.UpdateSecretSb(jsonId, sb) ' Long (1/0)` |
| `UpdateSecretStr` | method | `success = secrets.UpdateSecretStr(jsonId, secret) ' Long (1/0)` |

## Properties

### Secrets.AutoSplit

`Chilkat 11.7.0 · asp · Secrets · AutoSplit · property · read/write · since 10.1.0`

```visual-basic
secrets.AutoSplit  ' Long
```

The AutoSplit property is specific to `local_manager` secrets on Windows. The Windows Credentials Manager supports a maximum of 2560 bytes per secret. If a secret exceeds this size, it will be automatically compressed and split when created or updated, and automatically recomposed when retrieved.

A secret can be split into a maximum of 10 parts.

The default value is `1`.

### Secrets.Compression

`Chilkat 11.7.0 · asp · Secrets · Compression · property · read/write · since 10.1.0`

```visual-basic
secrets.Compression  ' Long
```

If set to `1`, then the contents of the secret will be stored compressed. The default value of this property is `0`.

### Secrets.Location

`Chilkat 11.7.0 · asp · Secrets · Location · property · read/write · since 10.1.0`

```visual-basic
secrets.Location  ' String
```

The location of the secrets. Possible values are:

- `local_manager` - On Windows this is the Credentials Manager. On MacOS and iOS it is the Keychain. This is not yet an option on Linux or Android.
- `aws_secrets_manager` - AWS Secrets Manager
- `azure_key_vault` - Azure Key Vault
- `ibm_cloud` - IBM Cloud Secrets Manager
- `oracle_cloud` - Oracle Cloud Secrets
- `doppler` - Doppler Secrets
- `memory` - In-Memory Secrets

The default location is the `local_manager`. On Linux and Android, `local_manager` will behave the same as `memory`.

### Secrets.UncommonOptions

`Chilkat 11.7.0 · asp · Secrets · UncommonOptions · property · read/write · since 10.1.0`

```visual-basic
secrets.UncommonOptions  ' String
```

This is a catch-all property to be used for uncommon needs. This property defaults to the empty string and should typically remain empty.

## Methods

### Secrets.DeleteSecret

`Chilkat 11.7.0 · asp · Secrets · DeleteSecret · method · since 10.1.0`

```visual-basic
success = secrets.DeleteSecret(jsonId)  ' Long (1/0)
```

Deletes a secret. Cloud secrets managers will typically disable the secret and schedule the secret for deletion after some number of days.

Returns 1 for success, 0 for failure.

### Secrets.GetSecretBd

`Chilkat 11.7.0 · asp · Secrets · GetSecretBd · method · since 10.1.0`

```visual-basic
success = secrets.GetSecretBd(jsonId, bd)  ' Long (1/0)
```

Fetches a binary secret and returns the content in `bd`.

Returns 1 for success, 0 for failure.

### Secrets.GetSecretJson

`Chilkat 11.7.0 · asp · Secrets · GetSecretJson · method · since 10.1.0`

```visual-basic
success = secrets.GetSecretJson(jsonId, jsonOut)  ' Long (1/0)
```

Fetches a JSON secret and returns the content in `jsonOut`.

Returns 1 for success, 0 for failure.

### Secrets.GetSecretSb

`Chilkat 11.7.0 · asp · Secrets · GetSecretSb · method · since 10.1.0`

```visual-basic
success = secrets.GetSecretSb(jsonId, sb)  ' Long (1/0)
```

Fetches a string secret and returns the content in `sb`.

Returns 1 for success, 0 for failure.

### Secrets.GetSecretStr

`Chilkat 11.7.0 · asp · Secrets · GetSecretStr · method · since 10.1.0`

```visual-basic
str = secrets.GetSecretStr(jsonId)  ' String
```

Fetches a string secret and returns the content of the secret.

Returns `Nothing` on failure

### Secrets.ListSecrets

`Chilkat 11.7.0 · asp · Secrets · ListSecrets · method · since 10.1.0`

```visual-basic
success = secrets.ListSecrets(json, jsonOut)  ' Long (1/0)
```

Lists secrets matching the wildcarded or exact values passed in `json`. The results of the query are returned in `jsonOut`.

Returns 1 for success, 0 for failure.

### Secrets.SecretSpecToJson

`Chilkat 11.7.0 · asp · Secrets · SecretSpecToJson · method · since 11.5.0`

```visual-basic
success = secrets.SecretSpecToJson(secretSpec, json)  ' Long (1/0)
```

Converts a secret specification string (`secretSpec`) to JSON. A secret specification string is formatted as "!!part1\|part2\|part3\|part4" where parts 3 and 4 are optional. `json` is the output argument.

Returns 1 for success, 0 for failure.

### Secrets.SetBootstrapSecret

`Chilkat 11.7.0 · asp · Secrets · SetBootstrapSecret · method · since 10.1.0`

```visual-basic
success = secrets.SetBootstrapSecret(jsonId, secretContent)  ' Long (1/0)
```

Accessing a cloud-based secrets manager requires authentication credentials, which cannot be stored in the manager itself. Instead, they must be securely stored locally.

One solution is to store the authentication credentials as a secret in the Windows Credentials Manager or Apple Keychain. These credentials serve as the `bootstrap secret` for authenticating with the cloud-based secrets manager.

`jsonId` contains the name of the bootstrap secret. `secretContent` contains the bootstrap's secret content.

Returns 1 for success, 0 for failure.

### Secrets.UpdateSecretBd

`Chilkat 11.7.0 · asp · Secrets · UpdateSecretBd · method · since 10.1.0`

```visual-basic
success = secrets.UpdateSecretBd(jsonId, secret)  ' Long (1/0)
```

Creates a binary secret if it does not yet exist, or updates an existing secret. The name of the secret is specified in `jsonId`, and the binary content of the secret in `secret`.

Returns 1 for success, 0 for failure.

### Secrets.UpdateSecretJson

`Chilkat 11.7.0 · asp · Secrets · UpdateSecretJson · method · since 10.1.0`

```visual-basic
success = secrets.UpdateSecretJson(jsonId, secret)  ' Long (1/0)
```

Creates a JSON secret if it does not yet exist, or updates an existing secret. The name of the secret is specified in `jsonId`, and the JSON content of the secret in `secret`.

Returns 1 for success, 0 for failure.

### Secrets.UpdateSecretSb

`Chilkat 11.7.0 · asp · Secrets · UpdateSecretSb · method · since 10.1.0`

```visual-basic
success = secrets.UpdateSecretSb(jsonId, sb)  ' Long (1/0)
```

Creates a string secret if it does not yet exist, or updates an existing secret. The name of the secret is specified in `jsonId`, and the string content of the secret in `sb`.

Returns 1 for success, 0 for failure.

### Secrets.UpdateSecretStr

`Chilkat 11.7.0 · asp · Secrets · UpdateSecretStr · method · since 10.1.0`

```visual-basic
success = secrets.UpdateSecretStr(jsonId, secret)  ' Long (1/0)
```

Creates a string secret if it does not yet exist, or updates an existing secret. The name of the secret is specified in `jsonId`, and the string content of the secret in `secret`.

Note: Starting in Chilkat **v11.3.0**, if the `service` = `"Chilkat"` and the `username` = `"unlock_code"`, then the secret (which is the Chilkat unlock code) can be stored and retrieved without Chilkat being unlocked. This allows for the Chilkat unlock code itself to be persisted to a secrets manager.

Returns 1 for success, 0 for failure.

## Events and callbacks

This binding has no event callbacks.

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/asp/classes/BinData.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/asp/classes/JsonObject.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/asp/classes/StringBuilder.md)

