使用安全吗std::string
使用 openssl 时的 key ?
我目前正在使用 std::vector<uint8_t>
用于管理用于 openssl API 的 key ,因为我不确定如何使用 std::string
处理不可打印的字符。
最佳答案
幸运的是,除了短字符串优化之类的东西,std::vector<char>
之间并没有太多区别。和 std::string
.
std::string
并不真正关心它包含什么,即使里面的字符不是有效的 ASCII/UTF8 字符/序列。
这是 std::basic_string
中的坏事之一,不幸的是,对于其余情况。
关于c++ - std::string 可以用于 openssl 加密 key 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38852618/