RSA_sign(3) OpenSSL RSA_sign(3) NNAAMMEE RSA_sign, RSA_verify - RSA signatures SSYYNNOOPPSSIISS #include 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); DDEESSCCRRIIPPTTIIOONN _R_S_A___s_i_g_n_(_) signs the message digest mm of size mm__lleenn using the private key rrssaa as specified in PKCS #1 v2.0. It stores the signature in ssiiggrreett and the signature size in ssiigglleenn. ssiiggrreett must point to RSA_size(rrssaa) bytes of memory. Note that PKCS #1 adds meta-data, placing limits on the size of the key that can be used. See _R_S_A___p_r_i_v_a_t_e___e_n_c_r_y_p_t(3) for lower-level operations. ttyyppee denotes the message digest algorithm that was used to generate mm. It usually is one of NNIIDD__sshhaa11, NNIIDD__rriippeemmdd116600 and NNIIDD__mmdd55; see _o_b_j_e_c_t_s(3) for details. If ttyyppee is NNIIDD__mmdd55__sshhaa11, an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding and no algorithm identi- fier) is created. _R_S_A___v_e_r_i_f_y_(_) verifies that the signature ssiiggbbuuff of size ssiigglleenn matches a given message digest mm of size mm__lleenn. ttyyppee denotes the message digest algorithm that was used to generate the signature. rrssaa is the signer's public key. RREETTUURRNN VVAALLUUEESS _R_S_A___s_i_g_n_(_) returns 1 on success, 0 otherwise. _R_S_A___v_e_r_i_f_y_(_) returns 1 on successful verification, 0 otherwise. The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3). BBUUGGSS Certain signatures with an improper algorithm identifier are accepted for compatibility with SSLeay 0.4.5 :-) CCOONNFFOORRMMIINNGG TTOO SSL, PKCS #1 v2.0 SSEEEE AALLSSOO _E_R_R___g_e_t___e_r_r_o_r(3), _o_b_j_e_c_t_s(3), _r_s_a(3), _R_S_A___p_r_i_v_a_t_e___e_n_c_r_y_p_t(3), _R_S_A___p_u_b_- _l_i_c___d_e_c_r_y_p_t(3) HHIISSTTOORRYY _R_S_A___s_i_g_n_(_) and _R_S_A___v_e_r_i_f_y_(_) are available in all versions of SSLeay and OpenSSL. 1.0.2u 2019-12-20 RSA_sign(3)