Skip to content

Commit 9505b51

Browse files
committed
p11test: Script epass2003 token setup
1 parent 0068771 commit 9505b51

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
File renamed without changes.

src/tests/p11test/runtest.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PIN="123456"
2424
export GNUTLS_PIN=$PIN
2525
GENERATE_KEYS=1
2626
PKCS11_TOOL="../../tools/pkcs11-tool";
27-
PKCS15_INIT="../../tools/pkcs15-init";
27+
PKCS15_INIT="env OPENSC_CONF=p11test_opensc.conf ../../tools/pkcs15-init"
2828
SC_HSM_TOOL="../../tools/sc-hsm-tool";
2929

3030
function generate_sym() {
@@ -130,7 +130,6 @@ function card_setup() {
130130
;;
131131
"myeid")
132132
GENERATE_KEYS=0 # we generate them directly here
133-
PKCS15_INIT="env OPENSC_CONF=myeid_opensc.conf $PKCS15_INIT"
134133
P11LIB="../../pkcs11/.libs/opensc-pkcs11.so"
135134
$PKCS15_INIT --erase-card
136135
$PKCS15_INIT -C --pin $PIN --puk $SOPIN --so-pin $SOPIN --so-puk $SOPIN
@@ -151,6 +150,18 @@ function card_setup() {
151150
$PKCS11_TOOL --module $P11LIB -l --pin $PIN --keypairgen --key-type rsa:2048 --id 10 --label="RSA key"
152151
$PKCS11_TOOL --module $P11LIB -l --pin $PIN --keypairgen --key-type EC:prime256v1 --label "EC key"
153152
;;
153+
"epass2003")
154+
GENERATE_KEYS=0 # we generate them directly here
155+
P11LIB="../../pkcs11/.libs/opensc-pkcs11.so"
156+
PIN="987654"
157+
SOPIN="1234567890"
158+
$PKCS15_INIT --erase-card -T
159+
$PKCS15_INIT --create-pkcs15 -T -p pkcs15+onepin --pin $PIN --puk 1234567890
160+
INIT="$PKCS15_INIT --auth-id 01 --so-pin $SOPIN --pin $PIN"
161+
$INIT --generate-key ec:prime256v1 --id 01 --label="EC key" --key-usage=sign,keyAgreement
162+
$INIT --generate-key rsa:2048 --id 02 --label="RSA key" --key-usage=sign,decrypt
163+
$PKCS15_INIT -F
164+
;;
154165
*)
155166
echo "Error: Missing argument."
156167
echo " Usage:"

0 commit comments

Comments
 (0)