Conversation
…::AddVersionHeader (set default to true to retain previous PgpCore's behaviour). This is associated with #193.
Implemented support for symmetric encryption and decryption
There was a problem hiding this comment.
Pull request overview
This pull request adds support for symmetric encryption and decryption to the PgpCore library, implementing functionality that was requested in PR #322. The changes include both the core encryption/decryption logic and comprehensive test coverage.
Changes:
- Added symmetric key support to EncryptionKeys model with new constructor and property
- Modified encryption/decryption logic to handle both asymmetric and symmetric encryption methods
- Added AddVersionHeader property to PGP class for controlling version header output
- Fixed spelling errors throughout the codebase ("algorithm" was misspelled as "algorithim")
- Updated constructors to accept raw byte[] passphrases in addition to string passphrases
- Added KeyType.Symmetric enum value and test coverage for symmetric-only encryption
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Fixed spelling errors for "algorithm" in documentation |
| PgpCore/PgpCore.csproj | Version bump to 6.6.0 with release notes |
| PgpCore/PGP.cs | Added AddVersionHeader property for version header control |
| PgpCore/PGP.EncryptSync.cs, PGP.EncryptAsync.cs | Added symmetric key encryption support via AddMethodRaw |
| PgpCore/PGP.DecryptSync.cs, PGP.DecryptAsync.cs | Added symmetric key decryption support with PgpPbeEncryptedData handling |
| PgpCore/Models/EncryptionKeys.cs | Added SymmetricKey property, new byte[] constructors, and symmetric-only constructor |
| PgpCore/Abstractions/IEncryptionKeys.cs | Added SymmetricKey property to interface |
| PgpCore/PGP.KeySync.cs, PGP.KeyAsync.cs | Fixed parameter names from "preferredSymetricKeyAlgorithms" to "preferredSymmetricKeyAlgorithms" |
| PgpCore.Tests/TestFactory.cs | Added KeyType.Symmetric support and SymmetricKey property |
| PgpCore.Tests/UnitTests/Decrypt/DecryptAsync.String.cs | Added dedicated symmetric encryption tests |
| Multiple test files | Added KeyType.Symmetric to test data and SymmetricKey initializers |
| PgpCore.Tests/PgpCore.Tests.csproj | Changed target framework (contains critical issue) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 43 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




Bringing in changes from #322