摘要: // 从文件加载证书 X509* load_certificate_from_file(const char* filename) { BIO* bio = BIO_new_file(filename, "r"); if (!bio) { fprintf(stderr, "Error opening 阅读全文
posted @ 2025-08-29 18:16 我不是萧海哇~~~ 阅读(15) 评论(0) 推荐(0)
摘要: int save_public_key_from_file(const char* filename,RSA *key) { BIO* bio = BIO_new_file(filename, "w"); if (!bio) return NULL; int ret = PEM_write_bio_ 阅读全文
posted @ 2025-08-29 16:01 我不是萧海哇~~~ 阅读(8) 评论(0) 推荐(0)
摘要: 测试代码: #include <openssl/rsa.h> #include <openssl/pem.h> #include <openssl/err.h> #include <string.h> void handle_openssl_errors() { ERR_print_errors_f 阅读全文
posted @ 2025-08-29 14:53 我不是萧海哇~~~ 阅读(12) 评论(0) 推荐(0)
摘要: 好的,这是一个非常经典且高效的位操作技巧,用于实现内存对齐(Memory Alignment)。我们来一步步拆解这行代码: uint32_t aligned = (n + 7u) & ~7u; 它的目的: 计算大于等于 n 的最小的、8字节对齐的数。 换句话说,它会把 n “向上取整”到最接近的 8 阅读全文
posted @ 2025-08-29 09:30 我不是萧海哇~~~ 阅读(14) 评论(0) 推荐(0)