> For the complete documentation index, see [llms.txt](https://docs.keeta.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeta.com/anchors/overview/encrypted-containers.md).

# Encrypted Containers

**Encrypted Containers** are a secure way to encrypt data and share it with specific Keeta accounts. They provide end-to-end encryption with built-in access control.

### **What Are They For**

Encrypted Containers solve a common problem in blockchain systems: how to share private data securely. Use cases include:

* **KYC documents**: Share identity verification documents with compliant anchors
* **Private transaction details**: Share sensitive payment information
* **Confidential certificates**: Distribute verifiable credentials
* **Secure messaging**: Send encrypted data between accounts

### **How Are They Constructed**

An Encrypted Container:

1. **Encrypts plaintext** for each authorized recipient using their public key
2. **Optionally signs** the container to prove authenticity
3. **Serializes to ASN.1** format for compact, standardized encoding

### **Advantages of the SDK**

The Encrypted Container implementation in the Anchor SDK:

* **Handles cryptographic complexity**: You don't need to understand ASN.1, key derivation, or cipher modes
* **Manages access control**: Automatically encrypts keys for each recipient
* **Provides verification**: Built-in signature support for authenticity
* **Optimizes size**: Automatic compression for large payloads
* **Ensures compatibility**: Standard encoding works across different implementations

### **Example: Creating and Sharing an Encrypted Container**

{% @github-files/github-code-block url="<https://github.com/KeetaNetwork/keetanet-examples/blob/main/src/anchor/encrypted-container.ts>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeta.com/anchors/overview/encrypted-containers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
