[WIP] Add RsaPrivateKey/RsaPublicKey inherent methods
#638
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.
Adds algorithm-specific inherent methods for encryption and signing prefixed with the algorithm name, e.g.
pkcs1v15_decrypt,pkcs1v15_sign, as an alternative to thePaddingSchemeandSignatureSchemetraits.We already have an entirely separate trait-based API from
PaddingSchemeandSignatureScheme, namely traits likeRandomizedEncryptor,RandomizedDecryptor, andDecryptor, along with the traits from thesignaturecrate. These traits are well-typed and enforce usage of a particular algorithm's family of types, but also seem to have overlapping responsibilities / use cases to thePaddingSchemeandSignatureSchemetraits.The current
PaddingSchemeandSignatureSchemetraits do let you mix encryption and signing operations with a single key type (along with different algorithms), but they're a little awkward to use and I don't think we're getting a whole lot out of the trait-based abstraction they provide which isn't provided better by the aforementioned well-typed traits.The goal of being able to execute any operation of any algorithm you want on a given key type can also be met by just having a bunch of methods which do exactly what you want, which is what this PR proposes.