#!/bin/bash # # This test checks various aspects of RSA signature generation # # It needs a card with a private key+certificate pair at ID 45 # # Run this from the regression test directory. . functions msg < $m msg "Signing and verifying using SHA1" run_check_status openssl dgst -sha1 -binary -out $d < $m p15_crypt -s --sha-1 --pkcs1 -i $d -o $s run_check_output "Verified OK" \ openssl dgst -verify $p -sha1 -signature $s < $m success else msg "" msg "The card doesn't seem to support 2048 bit RSA key generation." msg "Skipping test !" msg "" fi p15_erase --secret @01=0000 msg < $m msg "Signing and verifying using SHA1" run_check_status openssl dgst -sha1 -binary -out $d < $m p15_crypt -s --sha-1 --pkcs1 -i $d -o $s run_check_output "Verified OK" \ openssl dgst -verify $p -sha1 -signature $s < $m success else msg "" msg "The card doesn't seem to support 2048 bit RSA keys." msg "Skipping test !" msg "" fi p15_erase --secret @01=0000