-
Notifications
You must be signed in to change notification settings - Fork 47
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
Refactoring and examples for key interface #123
Merged
Merged
Conversation
This file contains 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
Xynnn007
force-pushed
the
main
branch
2 times, most recently
from
September 6, 2022 00:15
e62c788
to
5a708e3
Compare
flavio
previously approved these changes
Sep 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left some minor comments
Xynnn007
force-pushed
the
main
branch
2 times, most recently
from
September 7, 2022 13:39
9cf6d77
to
0247914
Compare
- Wrap the Signer and KeyPair trait object inside enums - Wrap ECDSA keys inside enum Signed-off-by: Xynnn007 <mading.ma@alibaba-inc.com>
- key pair generation and export - key pair generation, signing and verification - key pair import - docs for all above Signed-off-by: Xynnn007 <mading.ma@alibaba-inc.com>
flavio
approved these changes
Sep 8, 2022
lukehinds
approved these changes
Sep 8, 2022
flavio
added a commit
to flavio/sigstore-rs
that referenced
this pull request
Oct 7, 2022
Enhancements ============ * update user-agent value to be specific to sigstore-rs (sigstore#122) * remove /api/v1/version from client by (sigstore#121) * crate async fulcio client (sigstore#132) * Removed ring dependency (sigstore#127) Others ====== * Update dependencies * Refactoring and examples for key interface (sigstore#123) * Fix doc test failures (sigstore#136) Contributors ============ * Bob Callaway (@bobcallaway) * Bob McWhirter (@bobmcwhirter) * Flavio Castelli (@flavio) * Luke Hinds (@lukehinds) * Xynnn (@Xynnn007) Signed-off-by: Flavio Castelli <fcastelli@suse.com>
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.
Summary
Due to #27, there is a need to refactor the key_interface to deal with the following current problems:
signing_key
module, they must import the crates into theCargo.toml
, likep256
,p384
,signature
,digest
etc. It is better for users not to need to care about the underlying Elliptic Curves. They can directly usesigstore
crate without import any other crates to do all the key related operations.SigStoreSigner
. AlsoSigStoreSigner
is somehow overlapped functionally withSigner
trait object. It is good to combine them, and give a more easy way for users to convert a PEM/DER encoded private key into an object who implementssign
.Thus this PR includes
enum
s.Signer
trait object andSigStoreSigner
struct into anenum
namedSigStoreSigner
.Release Note
Added the new following APIs:
SigStoreKeyPair
enum
to_sigstore_signer()
forSigStoreKeyPair
to_sigstore_keypair()
forSigStoreSigner
ECDSAKeys
enum
, a wrapper forEcdsaKeys
Changed the following
struct
s:SigStoreSigner
into anenum
Changed the following APIs:
SigStoreSigner
:SigStoreSigner::new(SigningScheme::ECDSA_P256_SHA256_ASN1)
->SigningScheme::ECDSA_P256_SHA256_ASN1.create_signer()
Added the following examples due to typical scenarios:
Deleted the origin example:
To make it clear, an overview architecture of the implementation for key-interface was included.
Documentation
Please refer to the
key_interface
examples for the usages.