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

How to read in a private key and return its public key? #289

Open
Myzel394 opened this issue Jan 17, 2023 · 0 comments
Open

How to read in a private key and return its public key? #289

Myzel394 opened this issue Jan 17, 2023 · 0 comments

Comments

@Myzel394
Copy link

Hey I'm trying to figure out how to read in a private key (from a string in PEM format) and to export its public key.

This is what I've tried:

SERVER_PRIVATE_KEY = gpg.import_keys(base64.b64decode(life_constants.SERVER_PRIVATE_KEY))
SERVER_PUBLIC_KEY = gpg.export_keys(SERVER_PRIVATE_KEY.key_id)

This however only exports a huge public key block (?) but I only want to export the pure minimalistic public key, how do I do that?

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

No branches or pull requests

1 participant