拙网论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 209|回复: 0

RSA_sign, RSA_verify - RSA signatures

[复制链接]

949

主题

1001

帖子

3736

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3736
发表于 2019-1-29 20:25:31 | 显示全部楼层 |阅读模式
https://www.openssl.org/docs/manmaster/man3/RSA_sign.html
NAME
RSA_sign, RSA_verify - RSA signatures
SYNOPSIS #include <openssl/rsa.h> int RSA_sign(int type, const unsigned char *m, unsigned int m_len,              unsigned char *sigret, unsigned int *siglen, RSA *rsa); int RSA_verify(int type, const unsigned char *m, unsigned int m_len,                unsigned char *sigbuf, unsigned int siglen, RSA *rsa);DESCRIPTION
RSA_sign() signs the message digest m of size m_len using the private key rsa using RSASSA-PKCS1-v1_5 as specified in RFC 3447. It stores the signature in sigret and the signature size in siglen. sigret must point to RSA_size(rsa) bytes of memory. Note that PKCS #1 adds meta-data, placing limits on the size of the key that can be used. See RSA_private_encrypt(3) for lower-level operations.
type denotes the message digest algorithm that was used to generate m. If type is NID_md5_sha1, an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding and no algorithm identifier) is created.
RSA_verify() verifies that the signature sigbuf of size siglen matches a given message digest mof size m_len. type denotes the message digest algorithm that was used to generate the signature. rsa is the signer's public key.
RETURN VALUES
RSA_sign() returns 1 on success. RSA_verify() returns 1 on successful verification.
The error codes can be obtained by ERR_get_error(3).

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|抱朴守拙BBS

GMT+8, 2025-5-25 20:53 , Processed in 0.203129 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表