fle-dotnet
Field-Level Encryption with the Couchbase .NET SDK — CryptoManager setup, [EncryptedField] attribute, encrypting and decrypting document fields
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Field-Level Encryption with the Couchbase .NET SDK — CryptoManager setup, [EncryptedField] attribute, encrypting and decrypting document fields
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Couchbase SDK error handling — UnambiguousTimeoutException vs AmbiguousTimeoutException, DocumentNotFoundException, CasMismatchException, DurabilityImpossibleException, SDK debug logging, sdk-doctor connectivity diagnostics, retryable vs non-retryable errors, circuit breaker, error best practices
Couchbase SDK patterns for Rust — CAS optimistic locking, retry on CasMismatch, tokio bulk operations with join_all/FuturesUnordered, atomic counters, sub-document (MutateInSpec/LookupInSpec), array operations, exists, replica reads, touch/getAndTouch, preserve_expiry, error handling
Configure and optimize Couchbase SDK connections in Rust — async/tokio cluster setup, singleton pattern, wait_until_ready, timeouts, KV CRUD (upsert/insert/get/replace/remove), expiry, durability, sub-document operations
SQL++ queries with the Couchbase Rust SDK — scope.query, cluster.query, positional and named parameters, scan consistency, deserializing rows into structs, DML (INSERT/UPDATE/DELETE/UPSERT), MutationState RYOW
Testing Couchbase Rust applications — unit testing with mockall, integration testing with testcontainers-rs, scope/collection isolation
Distributed ACID transactions are not supported by the Couchbase Rust SDK 1.x — alternatives and workarounds
| name | fle-dotnet |
| summary | Field-Level Encryption with the Couchbase .NET SDK — CryptoManager setup, [EncryptedField] attribute, encrypting and decrypting document fields |
| description | Field-Level Encryption with the Couchbase .NET SDK — CryptoManager setup, [EncryptedField] attribute, encrypting and decrypting document fields |
| compatibility | .NET SDK 3.x. Couchbase.Extensions.Encryption NuGet package required. |
| metadata | {"last_verified":"2026-05","min_server_version":"6.0","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about connection setup","skill":"server-connection-dotnet"}]} |
dotnet add package Couchbase.Extensions.Encryption
using Couchbase;
using Couchbase.Encryption;
using Couchbase.Encryption.Attributes;
var keyBytes = new byte[64]; // 64-byte key for AES-256
var keyring = new InsecureKeyring(new Key("my-key-id", keyBytes));
var provider = new AeadAes256CbcHmacSha512Provider(keyring);
var cryptoManager = DefaultCryptoManager.Builder()
.DefaultEncrypter(provider.EncrypterForKey("my-key-id"))
.Decrypter(provider.Decrypter())
.Build();
var cluster = await Cluster.ConnectAsync("couchbase://localhost",
new ClusterOptions()
.WithCredentials("username", "Password!123")
.WithCryptoManager(cryptoManager));
var collection = await cluster.BucketAsync("myapp")
.ContinueWith(b => b.Result.DefaultCollectionAsync().Result);
using Couchbase.Encryption.Attributes;
public class UserDocument
{
public string Name { get; set; }
[EncryptedField(KeyName = "my-key-id")]
public string Ssn { get; set; }
[EncryptedField(KeyName = "my-key-id")]
public string CreditCard { get; set; }
}
// Write
var user = new UserDocument
{
Name = "Alice",
Ssn = "123-45-6789",
CreditCard = "4111111111111111"
};
await collection.UpsertAsync("user::alice", user);
// Read — decryption is automatic
var result = await collection.GetAsync("user::alice");
var doc = result.ContentAs<UserDocument>();
Console.WriteLine(doc.Ssn); // "123-45-6789"
fle for full concept reference