For full documentation, visit docs.postguard.eu.
.NET SDK for PostGuard encryption, published as E4A.PostGuard on NuGet. Allows .NET applications to encrypt files for recipients using identity-based encryption. This is a sending-side SDK: it handles encryption and upload, while decryption is handled by the recipient through postguard.eu or the mail plugins.
using E4A.PostGuard;
using E4A.PostGuard.Models;
var pg = new PostGuard(new PostGuardConfig
{
PkgUrl = "https://pkg.postguard.eu",
CryptifyUrl = "https://fileshare.postguard.eu"
});
var sealed = pg.Encrypt(new EncryptInput
{
Files = [new PgFile("report.txt", fileStream)],
Recipients = [pg.Recipient.Email("citizen@example.com")],
Sign = pg.Sign.ApiKey("PG-API-xxx")
});
var result = await sealed.UploadAsync();
Console.WriteLine(result.Uuid);See the full API reference for all encryption options, recipient types, and upload/notification methods.
- .NET 8.0+ SDK
- Rust toolchain (rustup)
The pg-ffi crate lives in the postguard repo. Build it first:
cd ../postguard/pg-ffi
./build.shThis compiles the Rust FFI crate and copies the native library to src/runtimes/.
dotnet build E4A.PostGuard.slnxSee postguard-examples/pg-dotnet.
Releases are automated with release-please. When changes land on main, release-please opens a release PR. Merging that PR triggers CI to download pre-built pg-ffi native libraries and publish the package to NuGet.
MIT