randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.58k stars 568 forks source link

Improve API of asymmetric algorithms #3706

Open reneme opened 1 year ago

reneme commented 1 year ago

This is a collection of potential API improvements found in #3609.

randombit commented 1 year ago

Another one: LMS and XMSS both have stateful operation, but there is no generic way to detect how many operations remain on a key. I think the fix here is fairly easy, add std::optional<uint64_t> remaining_operations() const on Private_Key which returns nullopt for non-stateful algorithms.

reneme commented 8 months ago

For the record, here's an example of the hoops one needs to jump through to load a private key that is not wrapped in PKCS#8: https://github.com/randombit/botan/discussions/3902#discussioncomment-8476815.