> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
