azure-security-keyvault-keys-dotnet
O que ela faz
Esta ferramenta permite que você gerencie chaves criptográficas de forma segura no Azure. Você pode criar, proteger, usar e excluir chaves para criptografar e descriptografar dados, além de assinar e verificar informações.
Quando usar
- ✓Quando precisar criar novas chaves de criptografia para proteger seus dados.
- ✓Ao querer usar chaves existentes para criptografar ou descriptografar informações.
- ✓Se necessitar assinar digitalmente dados para garantir sua autenticidade.
Link da skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-security-keyvault-keys-dotnet/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Crie uma chave RSA chamada 'minha-chave-segura' e me diga como usá-la para criptografar um texto.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Por baixo dos panos, esta ferramenta se conecta ao Azure Key Vault, um serviço seguro para armazenar segredos. Ela usa comandos específicos para instruir o Azure a realizar as operações de chave solicitadas, como criar ou usar uma chave para criptografia.
Conteúdo técnico (SKILL.md)
Tradução do texto original do autor no GitHub. Os comandos e códigos estão como no original.
Azure.Security.KeyVault.Keys (.NET)
Biblioteca cliente para gerenciar chaves criptográficas no Azure Key Vault e Managed HSM.
Instalação
dotnet add package Azure.Security.KeyVault.Keys
dotnet add package Azure.Identity
Versão Atual: 4.7.0 (estável)
Variáveis de Ambiente
KEY_VAULT_NAME=<your-key-vault-name>
# Or full URI
AZURE_KEYVAULT_URL=https://<vault-name>.vault.azure.net
Hierarquia de Clientes
KeyClient (key management)
├── CreateKey / CreateRsaKey / CreateEcKey
├── GetKey / GetKeys
├── UpdateKeyProperties
├── DeleteKey / PurgeDeletedKey
├── BackupKey / RestoreKey
└── GetCryptographyClient() → CryptographyClient
CryptographyClient (cryptographic operations)
├── Encrypt / Decrypt
├── WrapKey / UnwrapKey
├── Sign / Verify
└── SignData / VerifyData
KeyResolver (key resolution)
└── Resolve(keyId) → CryptographyClient
Autenticação
DefaultAzureCredential (Recomendado)
using Azure.Identity;
using Azure.Security.KeyVault.Keys;
var keyVaultName = Environment.GetEnvironmentVariable("KEY_VAULT_NAME");
var kvUri = $"https://{keyVaultName}.vault.azure.net";
var client = new KeyClient(new Uri(kvUri), new DefaultAzureCredential());
Service Principal
var credential = new ClientSecretCredential(
tenantId: "<tenant-id>",
clientId: "<client-id>",
clientSecret: "<client-secret>");
var client = new KeyClient(new Uri(kvUri), credential);
Gerenciamento de Chaves
Criar Chaves
// Create RSA key
KeyVaultKey rsaKey = await client.CreateKeyAsync("my-rsa-key", KeyType.Rsa);
Console.WriteLine($"Created key: {rsaKey.Name}, Type: {rsaKey.KeyType}");
// Create RSA key with options
var rsaOptions = new CreateRsaKeyOptions("my-rsa-key-2048")
{
KeySize = 2048,
HardwareProtected = false, // true for HSM-backed
ExpiresOn = DateTimeOffset.UtcNow.AddYears(1),
NotBefore = DateTimeOffset.UtcNow,
Enabled = true
};
rsaOptions.KeyOperations.Add(KeyOperation.Encrypt);
rsaOptions.KeyOperations.Add(KeyOperation.Decrypt);
KeyVaultKey rsaKey2 = await client.CreateRsaKeyAsync(rsaOptions);
// Create EC key
var ecOptions = new CreateEcKeyOptions("my-ec-key")
{
CurveName = KeyCurveName.P256,
HardwareProtected = true // HSM-backed
};
KeyVaultKey ecKey = await client.CreateEcKeyAsync(ecOptions);
// Create Oct (symmetric) key for wrap/unwrap
var octOptions = new CreateOctKeyOptions("my-oct-key")
{
KeySize = 256,
HardwareProtected = true
};
KeyVaultKey octKey = await client.CreateOctKeyAsync(octOptions);
Recuperar Chaves
// Get specific key (latest version)
KeyVaultKey key = await client.GetKeyAsync("my-rsa-key");
Console.WriteLine($"Key ID: {key.Id}");
Console.WriteLine($"Key Type: {key.KeyType}");
Console.WriteLine($"Version: {key.Properties.Version}");
// Get specific version
KeyVaultKey keyVersion = await client.GetKeyAsync("my-rsa-key", "version-id");
// List all keys
await foreach (KeyProperties keyProps in client.GetPropertiesOfKeysAsync())
{
Console.WriteLine($"Key: {keyProps.Name}, Enabled: {keyProps.Enabled}");
}
// List key versions
await foreach (KeyProperties version in client.GetPropertiesOfKeyVersionsAsync("my-rsa-key"))
{
Console.WriteLine($"Version: {version.Version}, Created: {version.CreatedOn}");
}
Atualizar Propriedades de Chave
KeyVaultKey key = await client.GetKeyAsync("my-rsa-key");
key.Properties.ExpiresOn = DateTimeOffset.UtcNow.AddYears(2);
key.Properties.Tags["environment"] = "production";
KeyVaultKey updatedKey = await client.UpdateKeyPropertiesAsync(key.Properties);
Excluir e Limpar Chaves
// Start delete operation
DeleteKeyOperation operation = await client.StartDeleteKeyAsync("my-rsa-key");
// Wait for deletion to complete (required before purge)
await operation.WaitForCompletionAsync();
Console.WriteLine($"Deleted key scheduled purge date: {operation.Value.ScheduledPurgeDate}");
// Purge immediately (if soft-delete is enabled)
await client.PurgeDeletedKeyAsync("my-rsa-key");
// Or recover deleted key
KeyVaultKey recoveredKey = await client.StartRecoverDeletedKeyAsync("my-rsa-key");
Backup e Restauração
// Backup key
byte[] backup = await client.BackupKeyAsync("my-rsa-key");
await File.WriteAllBytesAsync("key-backup.bin", backup);
// Restore key
byte[] backupData = await File.ReadAllBytesAsync("key-backup.bin");
KeyVaultKey restoredKey = await client.RestoreKeyBackupAsync(backupData);
…
Perguntas frequentes
O que é o Azure Key Vault?
É um serviço seguro na nuvem da Microsoft para armazenar e gerenciar chaves criptográficas, senhas e certificados.
O que são chaves criptográficas?
São como senhas secretas usadas para codificar (criptografar) e decodificar (descriptografar) informações, garantindo que apenas pessoas autorizadas possam acessá-las.
Qual a diferença entre KeyClient e CryptographyClient?
O KeyClient é para gerenciar as chaves (criar, excluir, etc.), enquanto o CryptographyClient é para usar as chaves em operações como criptografar, descriptografar ou assinar dados.
Detalhes
Descrição original do autor
Azure Key Vault Keys SDK for .NET. Client library for managing cryptographic keys in Azure Key Vault and Managed HSM. Use for key creation, rotation, encryption, decryption, signing, and verification.
Popularidade
- Estrelas no GitHub
- 48 mil
- Posição no ranking
- #3983
- Licença
- MIT
- Atualizada em
- 15/10/2026
Comentários
- …
Mais skills deste repositório
00-andruia-consultant
48 milAjuda seu agente a iniciar ou melhorar projetos de IA. Ele analisa código, sugere ferramentas e cria planos de ação em espanhol.
007
48 milFaz seu agente realizar auditorias de segurança e modelagem de ameaças. É útil para proteger projetos contra ataques e vulnerabilidades.
10-andruia-skill-smith
48 milAjuda seu agente a criar ou melhorar ferramentas de IA. Ele define como as ferramentas funcionam, escreve a documentação e valida a estrutura.
20-andruia-niche-intelligence
48 milFaz seu agente criar um resumo sobre um setor específico. É útil para entender o contexto, regras, padrões de uso e riscos de um projeto, usando fontes confiáveis.
Skills parecidas
reverse-engineer-anything
422 milAjuda seu agente a analisar apps e pacotes já publicados para explicar recursos, comparar versões ou orientar uma reconstrução, usando a ferramenta REA.
1password
394 milAjuda seu agente a configurar a CLI do 1Password, fazer login e ler ou injetar segredos sem imprimir seus valores no chat.
healthcheck
394 milAjuda seu agente a auditar o computador ou servidor que roda o OpenClaw em busca de riscos como SSH, firewall, atualizações e backups, com correções seguras.