Asymmetric key pairs, generation and restriction#19
Open
AndrewScull wants to merge 6 commits intoandroid:mainfrom
Open
Asymmetric key pairs, generation and restriction#19AndrewScull wants to merge 6 commits intoandroid:mainfrom
AndrewScull wants to merge 6 commits intoandroid:mainfrom
Conversation
Contributor
AndrewScull
commented
Sep 18, 2023
- Make all Ec2Key and OkpKey classes key pairs to match their definitions, simplify class design and allow easier code reuse.
- Introduce key generation for the key agreement key subclasses.
- Provide implementations to get a PublicKey from an OkpKey.
- Give a way to get just the public part of a key pair in cases where the private part should not be encoded with the key.
Move the private key handling into Ec2Key so that both signing and key agreement keys can have private keys.
Add a builder method that generates a key pair for the key being built. Use this from EcSigningKey and Ec2KeyAgreementKey to implement handy key generation methods.
Move the private key handling into OkpKey so that both signing and key agreement keys can have a private key.
Provide a method for generating OkpKeyAgreementKey instances and enhance the builds with a method that populates the fields with a generated key pair.
Each type of OkpKey overrides the method to provide the appropriate publick key. If using Java 15 or newer than the standard security providers are all that a client needs, otherwise a provider will needs to be installed that can handle these keys.
To enable a keypair to be encoded without exposing the private part, provide a method to return the same key with just the public information. This is a no-op if there is not private part to the key. This also adds methods to the builders that copy the values from an existing key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.