Files
zeekay a861d7dc50 rename: ziti → zt across all paths
- Repo names: ziti-* → zt-*
- Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt
- Docker images: hanzozt/ziti-* → hanzozt/zt-*
- C/Java/JS symbols: ziti_* → zt_*
- File and directory names updated
2026-02-18 18:34:07 -08:00

33 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2019 NetFoundry, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
conf=softhsm2.conf
lib=$1
pin=$2
[ -e ${conf} ] || exit 1
tokendir=$(awk '/^directories.tokendir/{print $3;}' ${conf})
mkdir -p ${tokendir}
export SOFTHSM2_CONF=${conf}
softhsm2-util --init-token --slot 0 --label 'zt-test-token' --so-pin ${pin} --pin ${pin}
pkcs11-tool --module ${lib} -p ${pin} -k --key-type rsa:2048 --id 01 --label zt-rsa-key
pkcs11-tool --module ${lib} -p ${pin} -k --key-type EC:prime256v1 --id 02 --label zt-ecdsa-key