Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Generate PublicKey from PrivateKey#187

Open
bliepp wants to merge1 commit intosybrenstuvel:main
base:main
Choose a base branch
Loading
frombliepp:pub_from_priv

Conversation

bliepp
Copy link

I know it's not that much of an important feature as a public key can be generated from a private key by simply doing

pubkey=rsa.PublicKey(privkey.n,privkey.e)

but I still find a separate method to be convenient as it eliminates a possible source of errors and increases readability.

With the rather simple implementation this would be just

pubkey=privkey.public_key()

thewh1teagle reacted with thumbs up emoji
@sybrenstuvel
Copy link
Owner

Thanks for the PR. I agree with you that it's good to have a dedicated method for this.

Before I can accept the PR it needs a bit of love, though. The new code should be covered by a unit test.

Maybe you could also write a little bit about this in the "Generating Keys" section ofdoc/usage.rst? Such new, useful functionality ought to be documented as well.

@bliepp
Copy link
Author

Thank you for your reply. I've written a test case in theKeyGenTest class and some documentation intousage.rst as you suggested.

Hope this is fine now.

@bliepp
Copy link
Author

bliepp commentedJan 20, 2022
edited
Loading

It's been a week since I fixed this PR. Is this okay now or is there something I need to change?

@sybrenstuvel
Copy link
Owner

From a glance it looks good, thanks. For personal reasons I can't spend more brain power on this now, sorry. I'll get back to you, no worries. If there happen to be things to change, I'll be explicit in what & how.

bliepp reacted with thumbs up emoji

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bliepp@sybrenstuvel

[8]ページ先頭

©2009-2025 Movatter.jp