我正在尝试编写代码来验证一些RSA签名.签名是使用OpenSSL命令行工具制作的,使用此命令行的等效命令:
openssl dgst -sha1 -sign private_key_file.pem < binary_data_file > sig
Run Code Online (Sandbox Code Playgroud)
我想用来libtomcrypt做验证:
以下是RSA验证函数的调用签名libtomcrypt:
int rsa_verify_hash_ex(
const unsigned char *sig, unsigned long siglen, // signature to verify
const unsigned char *hash, unsigned long hashlen, // hash value to check against sig
int padding, // defined constant value, see below
int hash_idx, // identifies which hash algorithm, see below
unsigned long saltlen, // specify salt length, see below
int *stat, // output parameter, returns whether verify succeeded or …Run Code Online (Sandbox Code Playgroud)