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

Add PrivateKey object for signing, only #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mandelsoft
Copy link

@mandelsoft mandelsoft commented Nov 30, 2024

Proposed Changes

Fully implementing rsa.Signer requires a private and public key. But if only signing is required, the private key would be
sufficient. Currently, the public key must be present and both must have the same Id. If one of those constraints is not satisfied signing with the private key is not possible.

Types of Changes

New Feature: introduce interface PrivateKey with sole signing method and provide appropriate context methods to find private keys.

Verification

Create keys without Id and use new FindPrivateKey method flavors.

Testing

Tests are added.

Linked Issues

User-Facing Change

Support finding private keys without matching public key usable for sole signing operation.

Further Comments

@IceManGreen
Copy link
Contributor

Thank you @mandelsoft for your proposition, this is indeed a better approach for private keys in KMS.
Also, this pull request might be the solution to #112.

Copy link
Contributor

@solcates solcates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and safe to me. Thanks for the contribution.

@IceManGreen
Copy link
Contributor

However, the code is still in addendum.go. The implementation should be in keys.go though.

@mandelsoft can you fix this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants