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

method to sort public keys #714

Closed
tomholub opened this issue Oct 19, 2021 · 1 comment · Fixed by #785
Closed

method to sort public keys #714

tomholub opened this issue Oct 19, 2021 · 1 comment · Fixed by #785
Assignees
Labels
actionable PR Submitted PR is submitted for this issue

Comments

@tomholub
Copy link
Collaborator

RecipientWithPubKeys should be renamed as RecipientWithSortedPubKeys and then we should ensure that the keys are always added into it sorted, regardless of where the keys are from, like local storage or remote server.

(or that there is a method to retrieve the pubkeys that is always sorted - sorting is quick so I don't mind dynamic either, as long as I'm not able to side-step the sorting and get keys unsorted)

related to #712

The sorting of keys is as follows:

  • non-revoked keys always first, sorted by expiration date, descending. Keys that never expire on top, keys that expire far in the future follow, near future after that, expired keys recently after that, long expired keys below.
  • revoked keys always at the very end of the list
@tomholub
Copy link
Collaborator Author

This issue deserves some unit tests of the sorting mechanism - find or generate some armored keys to test with.

@sosnovsky sosnovsky added the in progress Work on the issue is in progress label Oct 25, 2021
sosnovsky added a commit that referenced this issue Oct 26, 2021
@sosnovsky sosnovsky added PR Submitted PR is submitted for this issue and removed in progress Work on the issue is in progress labels Oct 26, 2021
tomholub pushed a commit that referenced this issue Oct 26, 2021
* issue #714 rename RecipientWithPubKeys to RecipientWithSortedPubKeys

* issue #714 sort recipient keys depending on expire date

* issue #714 update testRecipientKeysOrder
sosnovsky added a commit that referenced this issue Oct 26, 2021
@sosnovsky sosnovsky mentioned this issue Oct 26, 2021
5 tasks
sosnovsky added a commit that referenced this issue Oct 26, 2021
tomholub pushed a commit that referenced this issue Oct 26, 2021
* issue #714 pr updates

* issue #714 update pub keys sorting

Co-authored-by: Tom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable PR Submitted PR is submitted for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants