E4A.PostGuard
0.4.1
dotnet add package E4A.PostGuard --version 0.4.1
NuGet\Install-Package E4A.PostGuard -Version 0.4.1
<PackageReference Include="E4A.PostGuard" Version="0.4.1" />
<PackageVersion Include="E4A.PostGuard" Version="0.4.1" />
<PackageReference Include="E4A.PostGuard" />
paket add E4A.PostGuard --version 0.4.1
#r "nuget: E4A.PostGuard, 0.4.1"
#:package E4A.PostGuard@0.4.1
#addin nuget:?package=E4A.PostGuard&version=0.4.1
#tool nuget:?package=E4A.PostGuard&version=0.4.1
<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 | Versions 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. |
-
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.