mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-19 06:08:05 -05:00
Fixed PKCS11_MODULE_PATH name
This commit is contained in:
parent
687bd91531
commit
1977db24f1
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export MODULE_PATH=/usr/lib/libsofthsm2.so
|
export PKCS11_MODULE_PATH=/usr/lib/libsofthsm2.so
|
||||||
|
|
||||||
cat >config.py <<EOF
|
cat >config.py <<EOF
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
SECRET = "secret1"
|
SECRET = "secret1"
|
||||||
PKCS11MODULE = "$MODULE_PATH"
|
PKCS11MODULE = "$PKCS11_MODULE_PATH"
|
||||||
PKCS11PIN = "secret1"
|
PKCS11PIN = "secret1"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -14,10 +14,10 @@ softhsm2-util --delete-token --token osslsigncode
|
|||||||
softhsm2-util --init-token --free --label osslsigncode --pin secret1 --so-pin secret2
|
softhsm2-util --init-token --free --label osslsigncode --pin secret1 --so-pin secret2
|
||||||
|
|
||||||
# create and print a key pair
|
# create and print a key pair
|
||||||
pkcs11-tool --module $MODULE_PATH -l -k --key-type rsa:2048 --id a1b2 --label test --pin secret1
|
pkcs11-tool --module $PKCS11_MODULE_PATH -l -k --key-type rsa:2048 --id a1b2 --label test --pin secret1
|
||||||
pkcs11-tool --module $MODULE_PATH -l --pin secret1 -O
|
pkcs11-tool --module $PKCS11_MODULE_PATH -l --pin secret1 -O
|
||||||
|
|
||||||
# create and print a certificate
|
# create and print a certificate
|
||||||
openssl req -new -x509 -subj "/CN=TEST" -engine pkcs11 -keyform engine -key "pkcs11:token=osslsigncode;object=test;pin-value=secret1" -out test.crt
|
openssl req -new -x509 -subj "/CN=TEST" -engine pkcs11 -keyform engine -key "pkcs11:token=osslsigncode;object=test;pin-value=secret1" -out test.crt
|
||||||
openssl x509 -inform PEM -outform DER -in test.crt -out test.der
|
openssl x509 -inform PEM -outform DER -in test.crt -out test.der
|
||||||
pkcs11-tool --module $MODULE_PATH -l --id a1b2 --label test -y cert -w test.der --pin secret1
|
pkcs11-tool --module $PKCS11_MODULE_PATH -l --id a1b2 --label test -y cert -w test.der --pin secret1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user