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

Stringly-typed API inerited from the C FFI is hard to discover #81

Open
teythoon opened this issue Mar 16, 2023 · 1 comment
Open

Stringly-typed API inerited from the C FFI is hard to discover #81

teythoon opened this issue Mar 16, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@teythoon
Copy link
Contributor

While porting Sequoia to Botan, I spent quite a bit of time grepping/reading Botan's source and stepping through the library in order to find the right strings to pass to various constructors like Cipher::new and Privkey::create to specify the algorithm, or methods like Privkey::sign to specify the padding scheme.

I think defining enums for algorithms, cipher modes, and padding schemes and any kind of argument that is currently a string would make the interface much nicer and more discoverable.

@randombit
Copy link
Owner

Thanks for raising this issue. There are some similar debates happening wrt the C++ API, but there the situation is harder as C++ enums are so limited 😭 but there is no reason we could not provide Rust enumerations that then map to the expected FFI string.

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

No branches or pull requests

2 participants