PublicKey.used_explicit_encoding() in python wrapper#5282
Merged
reneme merged 1 commit intorandombit:masterfrom Feb 4, 2026
Merged
PublicKey.used_explicit_encoding() in python wrapper#5282reneme merged 1 commit intorandombit:masterfrom
PublicKey.used_explicit_encoding() in python wrapper#5282reneme merged 1 commit intorandombit:masterfrom
Conversation
This API is meaningful only for ECC keys and returns true if the loaded public key contained an explicitly defined ECC group.
12 tasks
There was a problem hiding this comment.
Pull request overview
This PR extends the Python Botan 3 wrapper with an API to detect whether an ECC public key uses an explicitly encoded group and adds tests around that behavior.
Changes:
- Adds a new FFI binding for
botan_pubkey_ecc_key_used_explicit_encodinginbotan3.py. - Exposes this via
PublicKey.used_explicit_encoding()in the Python wrapper, raising aBotanExceptionfor non‑ECC keys. - Extends
test_rsa_load_storeandtest_ecdhto verify the behavior for RSA keys, ECC keys with explicit groups, and standard named ECC groups.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/python/botan3.py | Binds the new FFI function and introduces PublicKey.used_explicit_encoding() with appropriate error handling for non‑ECC keys. |
| src/scripts/test_python.py | Adds unit tests covering used_explicit_encoding() for RSA keys (exception), an explicitly-parameterized ECC public key, and normal named ECDH groups (returns False). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PublicKey.uses_explicit_encoding() in python wrapperPublicKey.used_explicit_encoding() in python wrapper
randombit
approved these changes
Feb 4, 2026
This file contains hidden or 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
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.
This API is meaningful only for ECC keys and returns true if the loaded public key contained an explicitly defined ECC group.