Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-Level OpenPGP API #1911

Open
wants to merge 129 commits into
base: main
Choose a base branch
from
Open

High-Level OpenPGP API #1911

wants to merge 129 commits into from

Conversation

vanitasvitae
Copy link
Contributor

@vanitasvitae vanitasvitae commented Nov 15, 2024

This PR contains a high-level API for OpenPGP, which simplifies the following tasks:

  • Message Creation
    • OpenPGPMessageGenerator sets up an OpenPGPMessageOutputStream based on user configuration
  • Message Consumption
    • OpenPGPMessageProcessor processes encrypted / signed / compressed OpenPGP messages and emits the plaintext along with metadata
  • Certificate / Key Evaluation
    • OpenPGPCertificate acts as high-level API pendant to PGPPublicKeyRing, evaluating expiration / revocation / key signatures and allows the user to get verified information about the cert
    • OpenPGPKey provides similar high-level API pendant to PGPSecretKeyRing

I decided to use a common OpenPGP* naming scheme for the new HighLevel API classes and also decided to make use of general terminology from the book "OpenPGP for application developers" (https://openpgp.dev).

This PR is still pretty much very early work in progress (as is #1857, which will eventually integrate with this API), but I want you to be able to comment on it during the development phase already :)

@vanitasvitae vanitasvitae marked this pull request as draft November 15, 2024 23:28
@vanitasvitae vanitasvitae force-pushed the valiadateAPI branch 3 times, most recently from c5856b5 to b096e10 Compare December 3, 2024 11:48
@vanitasvitae
Copy link
Contributor Author

This PR is now based on #1926

@vanitasvitae
Copy link
Contributor Author

This PR contains #1931 and may need to be rebased if the other patch is merged.

@vanitasvitae
Copy link
Contributor Author

vanitasvitae commented Jan 2, 2025

@dghgit I noticed, that in many places you replaced

for (item : collection)
{

with

for (Iterator it = collection.iterator(); it.hasNext();)
{
    Item item = iterator.next();

I was under the impression that BC was now targeting Java 1.8 primarily, which already supports the former method of collection iteration.
Am I missing something? Why are the Iterators not using generics?

Edit: I see you recently made some changes for Java 4 and 5 compatibility.

@vanitasvitae vanitasvitae marked this pull request as ready for review January 27, 2025 11:11
@vanitasvitae
Copy link
Contributor Author

The PR is ready for review. Let me know if you like me to squash it for you :)

@vanitasvitae
Copy link
Contributor Author

As another cherry on top, I present to you bc-sop, which implements the stateless OpenPGP protocol as a native-image using Bouncy Castle :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants