33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
# ============================================================
|
||
# openssl — Viper 的 OpenSSL 3.x FFI 绑定包
|
||
#
|
||
# 用户用法:
|
||
# import openssl
|
||
# v = openssl.OpenSSL_version(openssl.OpenSslVersion) # 版本文本
|
||
# openssl.OPENSSL_init_ssl(0, None)
|
||
#
|
||
# 说明:
|
||
# * 全部为 extern FFI(extern def,直连 libcrypto/libssl 导出符号),
|
||
# 无 C++ 桥接层;对象均为不透明指针(openssl.types 里 *Ptr typedef)。
|
||
# * 头文件按 openssl 官方头分组:crypto/err/rand/sha/md5/hmac/objects/
|
||
# evp/bio/pem/x509/ssl。
|
||
# * 返回指针的函数返回 *Ptr,拿到对象后按需调用对应 *_free/SSL_free 等释放。
|
||
# * 密码回调类参数一律 bytes 占位,不使用时传 t.CPtr(0)/None。
|
||
# * 链接库:libcrypto + libssl(Windows 上 mingw 对应 -lcrypto -lssl)。
|
||
# ============================================================
|
||
|
||
import t
|
||
from openssl.types import *
|
||
from openssl.crypto import *
|
||
from openssl.err import *
|
||
from openssl.rand import *
|
||
from openssl.sha import *
|
||
from openssl.md5 import *
|
||
from openssl.hmac import *
|
||
from openssl.objects import *
|
||
from openssl.evp import *
|
||
from openssl.bio import *
|
||
from openssl.pem import *
|
||
from openssl.x509 import *
|
||
from openssl.ssl import *
|