#!/bin/bash # # This test checks various aspects of RSA decryption # # It needs a card with a private key+certificate pair at ID 45 # # Run this from the regression test directory. . functions msg < $o run_check_status openssl rsautl -pubin -inkey $p -encrypt -in $o -out $e p15_crypt -c --pkcs1 -i $e -o $d cmp $o $d || fail "Decrypted file does not match plain text file" 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 < $o run_check_status openssl rsautl -pubin -inkey $p -encrypt -in $o -out $e p15_crypt -c --pkcs1 -i $e -o $d cmp $o $d || fail "Decrypted file does not match plain text file" 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