jps3318 wrote:
> 
> Is there an openssl command line equivalent to: 
>  RSA_sign(NID_sha1, hash, 20, sig, &siglen, rsa_pkey);
> and/or
>  RSA_verify(NID_sha1, hash, 20, sigbuf, siglen, rsa_pkey)
> 
> These functions work fine for signing and verifying data from a c program,
> but I can't figure out if there is an openssl command that can be used
> instead.  I've tried various openssl commands such as rsautl and rsa, but
> can't find anything equivalent.
> 
> I am trying to write a server script that will use the openssl command
> line to sign a message, and then send it to a client where it will be
> verified by a c program.
> 
> 

Found the answer.  The following commands work interchangeably with API's
RSA_sign and RSA_verify.
 
openssl dgst -sha1 -sign privkey.pem -out message.sha1 message

openssl dgst -sha1 -verify pubkey.pem -signature message.sha1 message



-- 
View this message in context: 
http://old.nabble.com/Is-there-an-openssl-command-line-equivalent-to-RSA_sign-and-RSA_verify--tp31049735p31050604.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to