PostQuantum.FileEncryption.AzureKeyVault 1.4.1

Requires NuGet 6.0.0 or higher.

dotnet add package PostQuantum.FileEncryption.AzureKeyVault --version 1.4.1
                    
NuGet\Install-Package PostQuantum.FileEncryption.AzureKeyVault -Version 1.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PostQuantum.FileEncryption.AzureKeyVault" Version="1.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PostQuantum.FileEncryption.AzureKeyVault" Version="1.4.1" />
                    
Directory.Packages.props
<PackageReference Include="PostQuantum.FileEncryption.AzureKeyVault" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PostQuantum.FileEncryption.AzureKeyVault --version 1.4.1
                    
#r "nuget: PostQuantum.FileEncryption.AzureKeyVault, 1.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PostQuantum.FileEncryption.AzureKeyVault@1.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PostQuantum.FileEncryption.AzureKeyVault&version=1.4.1
                    
Install as a Cake Addin
#tool nuget:?package=PostQuantum.FileEncryption.AzureKeyVault&version=1.4.1
                    
Install as a Cake Tool

PostQuantum.FileEncryption.AzureKeyVault

Envelope encryption with Azure Key Vault or Managed HSM — the key-encryption key never leaves the vault. AzureKeyVaultContentKeyProvider plugs Key Vault into PostQuantum.FileEncryption's IContentKeyProvider seam: every file is encrypted under a fresh per-file content key that the vault wraps (RSA-OAEP-256 by default); decryption sends only the small wrapped blob back for unwrap.

dotnet add package PostQuantum.FileEncryption.AzureKeyVault

Usage

using Azure.Identity;
using Azure.Security.KeyVault.Keys.Cryptography;
using PostQuantum.FileEncryption;
using PostQuantum.FileEncryption.AzureKeyVault;

// Prefer a VERSIONED key URI so old files stay decryptable across key rotation.
var client = new CryptographyClient(
    new Uri("https://my-vault.vault.azure.net/keys/pqfe-kek/0123456789abcdef0123456789abcdef"),
    new DefaultAzureCredential());
var provider = new AzureKeyVaultContentKeyProvider(client);

await new PqFileEncryptor().EncryptFileAsync("report.pdf", "report.pdf.pqfe", provider);
await new PqFileDecryptor().DecryptFileAsync("report.pdf.pqfe", "report.pdf", provider);

On Managed HSM with a symmetric key, pick AES key wrap explicitly:

var provider = new AzureKeyVaultContentKeyProvider(client, KeyWrapAlgorithm.A256KW);

Security behavior

  • The key-encryption key stays in the vault/HSM. Only the per-file content key crosses the boundary, and only wrapped. Rotation re-wraps the small content key — multi-gigabyte payloads are never re-encrypted.
  • Pinned unwrap. The wrap records the exact (versioned) key id that produced it; unwrap requires it to match the configured client's key and always uses the configured algorithm — an algorithm or key id smuggled into a hostile container header is never honored. Cryptographic failures fail closed with PqDecryptionException.
  • Operational errors stay operational. Authentication, authorization, throttling, and network failures surface as the Azure SDK's own exceptions, not as decryption failures.
  • Key permissions needed: wrapKey to encrypt, unwrapKey to decrypt.

Versioning

Kept in lockstep with PostQuantum.FileEncryption. No change to the .pqfe v2 container format, which remains FROZEN for the 1.x line.


To God be the glory — 1 Corinthians 10:31.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.1 244 6/13/2026
1.4.0 252 6/13/2026

1.4.1 — documentation and packaging patch, versioned in lockstep with the PostQuantum.FileEncryption family: corrects the package README version references following the 1.4.0 first release. No change to the provider's behavior, API, or the .pqfe v2 container format, which remains FROZEN for the 1.x line.