E4A.PostGuard 0.4.1

dotnet add package E4A.PostGuard --version 0.4.1
                    
NuGet\Install-Package E4A.PostGuard -Version 0.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="E4A.PostGuard" Version="0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="E4A.PostGuard" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="E4A.PostGuard" />
                    
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 E4A.PostGuard --version 0.4.1
                    
#r "nuget: E4A.PostGuard, 0.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 E4A.PostGuard@0.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=E4A.PostGuard&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=E4A.PostGuard&version=0.4.1
                    
Install as a Cake Tool

<p align="center"><img src="./img/pg_logo.svg" height="128px" alt="PostGuard" /></p>

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.

Quick Start

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.

Development

Prerequisites

  • .NET 8.0+ SDK
  • Rust toolchain (rustup)

Build native library

The pg-ffi crate lives in the postguard repo. Build it first:

cd ../postguard/pg-ffi
./build.sh

This compiles the Rust FFI crate and copies the native library to src/runtimes/.

Build the .NET solution

dotnet build E4A.PostGuard.slnx

Run the example

See postguard-examples/pg-dotnet.

Releasing

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.

License

MIT

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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
0.4.1 100 5/18/2026
0.4.0 93 5/16/2026
0.3.0 134 5/2/2026
0.2.1 129 4/10/2026
0.2.0 99 4/10/2026
0.1.1 102 4/10/2026
0.1.0 96 4/10/2026