Skip to content

Add PrivateKey object for signing, only#111

Open
mandelsoft wants to merge 2 commits intoThalesGroup:masterfrom
mandelsoft:master
Open

Add PrivateKey object for signing, only#111
mandelsoft wants to merge 2 commits intoThalesGroup:masterfrom
mandelsoft:master

Conversation

@mandelsoft
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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