Generate private key: openssl genrsa -out privkey.pem -3des 2048 Extract private key: openssl rsa -in privkey.pem -pubout -out pubkey.pem Calculate sha1 sum and sign it with the priv key: sha1 file | openssl rsautl -sign -inkey privkey.pem -out file.sum Verify the sum and compare with sum of file: openssl rsautl -verify -pubin -inkey pubkey.pem -in file.sum | sha1 -c