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

Define padding method for each CryptogramDataBuilder #612

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

tilln
Copy link
Contributor

@tilln tilln commented Sep 11, 2024

PR #577 introduced the ability to create padded ARQC data.
However, it still requires the caller to specify what padding method to use, while ideally this should be handled by the CryptogramDataBuilder internally.

This PR proposes the following changes:

  • buildARQCRequest_padded signature change: Remove the padding method parameter and instead define the padding method for each CryptogramDataBuilder as a polymorphic method getPaddingMethod. The parameter removal causes no loss of flexibility as users may now override getPaddingMethod in a CryptogramDataBuilder subclass.
  • buildARQCRequest_padded is moved up to the CryptogramDataBuilder interface as a default method to keep code DRY.
  • PaddingMethod changed to enum, to enable toString().

These are not breaking changes as they impact only 2.1.10-SNAPSHOT and 3.0.0-SNAPSHOT, but not proper releases yet.

@ar ar merged commit 0be52e0 into jpos:master Sep 11, 2024
5 checks passed
@tilln tilln deleted the feature/arqc-padding branch September 11, 2024 21:35
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