Add AllPrimitives and AllPrimitivesWithKeyManager #16
+151
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These new methods on the keyset handle complement
Primitives
andPrimitivesWithKeyManager
, but return all primitives, not just enabled primitives. This can be useful for key implementations to display information about key parameters, but should not be used to create sets for encryption duties, since only enabled keys should be used for encryption.Done by adding a filter function to the private
primitives
method, and havingPrimitives
andPrimitivesWithKeyManager
use it to filter for enabled keys, whileAllPrimitives
andAllPrimitivesWithKeyManager
don't filter. This keeps the code changes to a minimum. Also: add test to ensure that disabled keys are included in theAll
methods but excluded in the non-All
methods.Requires disabling the check for enabled keys in
primitiveset
; should probably change it to allow the adding of other keys through a separate method or something, but I wanted to get some feedback and discussion going before I dove into that, so simply commenting out that check (and the corresponding test) for now.See discussion in #14 for some of the background on this proposal.