crypt0002

来自「读写Smart卡加解密接口的程序」· 代码 · 共 37 行

TXT
37
字号
#!/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.. functionsmsg <<EOF:::::: Testing on-card decryption facilities:::EOFo=$p15temp/plaintexte=$p15temp/encryptedd=$p15temp/decryptedp=$p15temp/key.pemp15_init --no-so-pinp15_set_pin -a 01p15_gen_key rsa/1024 --id 45 --key-usage decrypt -a 01msg "Extracting public key"run_check_status $p15tool --read-public-key 45 -o $pmsg "Encrypting message (pkcs1 padding)"echo lalla > $orun_check_status openssl rsautl -pubin -inkey $p -encrypt -in $o -out $ep15_crypt -c --pkcs1 -i $e -o $dcmp $o $d || fail "Decrypted file does not match plain text file"successp15_erase --secret @01=0000

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?