PgpCore 2.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PgpCore --version 2.3.0
NuGet\Install-Package PgpCore -Version 2.3.0
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="PgpCore" Version="2.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PgpCore --version 2.3.0
#r "nuget: PgpCore, 2.3.0"
#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.
// Install PgpCore as a Cake Addin
#addin nuget:?package=PgpCore&version=2.3.0

// Install PgpCore as a Cake Tool
#tool nuget:?package=PgpCore&version=2.3.0

PgpCore

A .NET Core class library for using PGP.

This is based on <a href="https://github.com/Cinchoo/ChoPGP" alt="ChoPGP">ChoPGP</a> but updated to .NET Core framework and to add in a missing utilities class.

Installation

To use PgpCore in your C# project, you can either download the PgpCore C# .NET libraries directly from the Github repository or, if you have the NuGet package manager installed, you can grab them automatically.

PM> Install-Package PgpCore

Once you have the PgpCore libraries properly referenced in your project, you can include calls to them in your code.

Add the following namespaces to use the library:

using PgpCore;

Dependencies

BouncyCastle.NetCore (>= 1.8.1.3)

Microsoft.NETCore.App (>= 1.1.2)

Usage

This is intended for usage in .NET Core projects. For further examples see the tests.

using (PGP pgp = new PGP())
{
                // Generate keys
                pgp.GenerateKey(@"C:\TEMP\keys\public.asc", @"C:\TEMP\keys\private.asc", "email@email.com", "password");
                // Encrypt file
                pgp.EncryptFile(@"C:\TEMP\keys\content.txt", @"C:\TEMP\keys\content__encrypted.pgp", @"C:\TEMP\keys\public.asc", true, true);
		// Encrypt file with multiple keys
		string[] publicKeys = Directory.GetFiles("C:\TEMP\keys\", "*.asc);
                pgp.EncryptFile(@"C:\TEMP\keys\content.txt", @"C:\TEMP\keys\content__encrypted.pgp", publicKeys, true, true);
                // Encrypt and sign file
                pgp.EncryptFileAndSign(@"C:\TEMP\keys\content.txt", @"C:\TEMP\keys\content__encrypted_signed.pgp", @"C:\TEMP\keys\public.asc", @"C:\TEMP\keys\private.asc", "password", true, true);
                // Decrypt file
                pgp.DecryptFile(@"C:\TEMP\keys\content__encrypted.pgp", @"C:\TEMP\keys\content__decrypted.txt", @"C:\TEMP\keys\private.asc", "password");
                // Decrypt signed file
                pgp.DecryptFile(@"C:\TEMP\keys\content__encrypted_signed.pgp", @"C:\TEMP\keys\content__decrypted_signed.txt", @"C:\TEMP\keys\private.asc", "password");

                // Encrypt stream
                using (FileStream inputFileStream = new FileStream(@"C:\TEMP\keys\content.txt", FileMode.Open))
                using (Stream outputFileStream = File.Create(@"C:\TEMP\keys\content__encrypted2.pgp"))
                using (Stream publicKeyStream = new FileStream(@"C:\TEMP\keys\public.asc", FileMode.Open))
                    pgp.EncryptStream(inputFileStream, outputFileStream, publicKeyStream, true, true);

                // Decrypt stream
                using (FileStream inputFileStream = new FileStream(@"C:\TEMP\keys\content__encrypted2.pgp", FileMode.Open))
                using (Stream outputFileStream = File.Create(@"C:\TEMP\keys\content__decrypted2.txt"))
                using (Stream privateKeyStream = new FileStream(@"C:\TEMP\keys\private.asc", FileMode.Open))
                    pgp.DecryptStream(inputFileStream, outputFileStream, privateKeyStream, "password");
}

A good resource for generating keys and messages is <a href="https://wp2pgpmail.com/pgp-key-generator/" alt="PGP Key Generator">PGP Key Generator</a>.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on PgpCore:

Package Downloads
DTF.Services.Common.V2

DTF common services.

APF.Core

Package Description

Hona.Tool

消息队列,如:kafka等

EDennis.AspNetCore.Utils

Provides various classes that assist with ASP.NET Core 2 development.

Sonar.Lib.SFTP

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on PgpCore:

Repository Stars
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
automuteus/amonguscapture
Capture of the local Among Us executable state
Version Downloads Last updated
6.3.1 119,936 12/19/2023
5.13.1 44,275 11/15/2023
5.13.0 49,632 10/21/2023
5.10.0 455,050 3/23/2023
5.9.0 380,955 11/16/2022
5.8.1 297,121 9/6/2022
5.7.0 177,046 7/11/2022
5.6.0 70,389 6/8/2022
5.5.0 622,266 11/19/2021
5.4.0 20,236 11/14/2021
5.3.2 27,786 11/5/2021
5.3.1 182,167 9/14/2021
5.3.0 32,986 8/27/2021
5.2.0 673,893 4/16/2021
5.1.0 72,871 2/2/2021
4.0.1 157,836 12/14/2020
4.0.0 41,789 12/1/2020
3.2.0 254,077 10/28/2020
3.1.0 30,531 10/16/2020
2.4.2 231,957 7/30/2020
2.4.1 15,789 6/29/2020
2.4.0 17,023 5/13/2020
2.3.0 29,219 3/30/2020
2.2.0 407,255 1/15/2020
2.1.1 33,236 11/20/2019
2.1.0 83,651 9/18/2019
2.0.0 88,278 8/28/2019
1.7.2 94,440 8/20/2019
1.7.0 99,395 7/24/2019
1.6.0 8,442 7/4/2019
1.4.1 177,465 3/29/2019
1.4.0 64,406 2/20/2019
1.3.1 33,621 12/6/2018
1.3.0 1,032 12/3/2018
1.2.1 29,970 8/20/2018
1.2.0 17,390 7/4/2018
1.1.1 6,620 2/10/2018
1.1.0 108,416 9/15/2017
1.0.3 1,248 8/3/2017
1.0.2 1,271 6/8/2017
1.0.1 1,253 6/5/2017
1.0.0 1,991 6/2/2017

v2.3.0 - Handle read-only inputs and null source error handling.