AZ

azure-keyvault-keys-rust

Rust library for managing and utilizing cryptographic keys within Azure Key Vault.

Install

mkdir -p .claude/skills/azure-keyvault-keys-rust-ricardoaevt && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13716" && unzip -o skill.zip -d .claude/skills/azure-keyvault-keys-rust-ricardoaevt && rm skill.zip

Installs to .claude/skills/azure-keyvault-keys-rust-ricardoaevt

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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".
190 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Create cryptographic keys of various types
  • Retrieve existing keys by name
  • Delete keys from Key Vault
  • List properties of keys in the vault
  • Backup and restore keys for disaster recovery
  • Perform cryptographic operations without exposing private keys

How it works

This skill provides a Rust client for Azure Key Vault, enabling operations like creating, retrieving, deleting, and backing up cryptographic keys. It uses `DeveloperToolsCredential` for authentication and supports various key types.

Inputs & outputs

You give it
Key name, key type, and optional parameters like key size or curve name
You get back
A Key Vault key object, key properties, or a backup of a key

When to use azure-keyvault-keys-rust

  • Create cryptographic keys
  • Sign data with vault keys
  • Encrypt data securely
  • Manage key versions

About this skill

Azure Key Vault Keys SDK for Rust

Client library for Azure Key Vault Keys — secure storage and management of cryptographic keys.

Installation

cargo add azure_security_keyvault_keys azure_identity

Environment Variables

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

TypeDescription
RSARSA keys (2048, 3072, 4096 bits)
ECElliptic curve keys (P-256, P-384, P-521)
RSA-HSMHSM-protected RSA keys
EC-HSMHSM-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: 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: 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)?.into_stream();
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?;
// Store backup.value safely

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 authDeveloperToolsCredential 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 RSA for encryption — when encrypting data
  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 operations
  • Key Vault Crypto Officer — full CRUD on keys

Reference Links

ResourceLink
API Referencehttps://docs.rs/azure_security_keyvault_keys
Source Codehttps://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/keyvault/azure_security_keyvault_keys
crates.iohttps://crates.io/crates/azure_security_keyvault_keys

When not to use it

  • When not working with Azure Key Vault for key management
  • When a Rust client library is not suitable for the project

Prerequisites

AZURE_KEYVAULT_URL environment variableazure_security_keyvault_keys Rust packageazure_identity Rust package

Limitations

  • Cryptographic operations depend on key type and assigned permissions
  • Requires specific RBAC permissions like 'Key Vault Crypto User' or 'Key Vault Crypto Officer'

How it compares

This skill offers a direct Rust client for managing cryptographic keys in Azure Key Vault, providing programmatic control over key lifecycle and operations, unlike manual key management through the Azure portal.

Compared to similar skills

azure-keyvault-keys-rust side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
azure-keyvault-keys-rust (this skill)05moReviewIntermediate
stellar-dev03moNo flagsAdvanced
solana-dev04moReviewAdvanced
solana-dev04moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry