azure-keyvault-keys-rust – Coding skill for AI agents
Azure Key Vault Keys SDK for Rust. Use for creating, managing, and using cryptographic keys. Triggers: "keyvault keys rust", "KeyClient rust", "create key rust", "encrypt rust", "sign rust".
Install the azure-keyvault-keys-rust skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-keyvault-keys-rust-1a6f6.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /azure-keyvault-keys-rust – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-keyvault-keys-rust-1a6f6.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $azure-keyvault-keys-rust – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-keyvault-keys-rust-1a6f6.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /azure-keyvault-keys-rust – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-keyvault-keys-rust-1a6f6.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /azure-keyvault-keys-rust – then describe the task you want done.
SKILL.md content
Azure Key Vault Keys SDK for Rust
Client library for Azure Key Vault Keys — secure storage and management of cryptographic keys.
The examples below require a reviewed compatible crate set and replacement of every resource placeholder. Do not use production data for demonstration writes.
Installation
cargo add azure_security_keyvault_keys@=1.0.1 azure_identity@=1.0.0 azure_core@=1.1.0Environment Variables
export AZURE_KEYVAULT_URL="https://<vault-name>.vault.azure.net/"Authentication
use azure_identity::DeveloperToolsCredential;
use azure_security_keyvault_keys::KeyClient;
let credential = DeveloperToolsCredential::new(None)?;
let client = KeyClient::new(
"https://<vault-name>.vault.azure.net/",
credential.clone(),
None,
)?;Key Types
| Type | Description |
|------|-------------|
| RSA | RSA keys (2048, 3072, 4096 bits) |
| EC | Elliptic curve keys (P-256, P-384, P-521) |
| RSA-HSM | HSM-protected RSA keys |
| EC-HSM | HSM-protected EC keys |
Core Operations
Get Key
let key = client
.get_key("key-name", None)
.await?
.into_model()?;
println!("Key ID: {:?}", key.key.as_ref().map(|k| &k.kid));Create Key
use azure_security_keyvault_keys::models::{CreateKeyParameters, KeyType};
let params = CreateKeyParameters {
kty: Some(KeyType::Rsa),
key_size: Some(2048),
..Default::default()
};
let key = client
.create_key("key-name", params.try_into()?, None)
.await?
.into_model()?;Create EC Key
use azure_security_keyvault_keys::models::{CreateKeyParameters, KeyType, CurveName};
let params = CreateKeyParameters {
kty: Some(KeyType::Ec),
curve: Some(CurveName::P256),
..Default::default()
};
let key = client
.create_key("ec-key", params.try_into()?, None)
.await?
.into_model()?;Delete Key
client.delete_key("key-name", None).await?;List Keys
use azure_security_keyvault_keys::ResourceExt;
use futures::TryStreamExt;
let mut pager = client.list_key_properties(None)?;
while let Some(key) = pager.try_next().await? {
let name = key.resource_id()?.name;
println!("Key: {}", name);
}Backup Key
let backup = client.backup_key("key-name", None).await?.into_model()?;
// Store the returned encrypted backup securely; do not print it.Restore Key
use azure_security_keyvault_keys::models::RestoreKeyParameters;
let params = RestoreKeyParameters {
key_bundle_backup: backup_bytes,
};
client.restore_key(params.try_into()?, None).await?;Cryptographic Operations
Key Vault can perform crypto operations without exposing the private key:
// For cryptographic operations, use the key's operations
// Available operations depend on key type and permissions:
// - encrypt/decrypt (RSA)
// - sign/verify (RSA, EC)
// - wrapKey/unwrapKey (RSA)Best Practices
1. Use Entra ID auth — DeveloperToolsCredential for dev, ManagedIdentityCredential for production
2. Use HSM keys for sensitive workloads — hardware-protected keys
3. Use EC for signing — more efficient than RSA
4. Use envelope encryption — RSA can wrap a symmetric data key; do not encrypt arbitrary bulk data directly with RSA
5. Backup keys — for disaster recovery
6. Enable soft delete — required for production vaults
7. Use key rotation — create new versions periodically
RBAC Permissions
Assign these Key Vault roles:
Key Vault Crypto User— use keys for crypto operationsKey Vault Crypto Officer— full CRUD on keys
The reviewed example set uses azure_security_keyvault_keys 1.0.1 and compatible Azure core/credential crates. Record and commit Cargo.lock; source/API review is not a compiler or live-service test.
Reference Links
| Resource | Link |
|----------|------|
| API Reference | https://docs.rs/azure_security_keyvault_keys |
| Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/keyvault/azure_security_keyvault_keys |
| crates.io | https://crates.io/crates/azure_security_keyvault_keys |
When to Use
Use when a Rust application retrieves public key metadata or performs authorized Key Vault key creation, versioning, backup, restoration or cryptographic operations.
Limitations
- Examples are fragments inside async application code, with compatible pinned Azure crates and the required Tokio/Serde/Futures dependencies; verify the selected version’s API before use. They were reviewed against official source/reference, not compiled or run against a cloud account here.
- Use an authorized tenant, resource and identity with least privilege. Writes, overwrites, deletes, backup retrieval and account changes require the corresponding scope; cleanup may remove only explicitly identified disposable resources. Bound requests, retries and downloaded bytes, and do not log payloads, credentials or secret values.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related skills
- azure-keyvault-secrets-rust – Azure Key Vault Secrets SDK for Rust. Use for storing and retrieving secrets, passwords…
- azure-messaging-webpubsub-java – Build real-time web applications with Azure Web PubSub SDK for Java. Use when…
- modern-javascript-patterns – Master ES6+ features including async/await, destructuring, spread operators, arrow…
- monorepo-management – Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient…
- cto-advisor – Technical leadership guidance for engineering teams, architecture decisions, and…
- cto-review – /c-level-agents:cto-review [plan] — Architecture and scaling interrogation. Tech debt…
- imessage – Send and receive iMessages/SMS via the imsg CLI on macOS.
- multi-reviewer-patterns – Coordinate parallel code reviews across multiple quality dimensions with finding…