add function to extract etoken pubkey
This commit is contained in:
parent
489a8ecff0
commit
edeae7c201
1 changed files with 16 additions and 0 deletions
16
functions.sh
16
functions.sh
|
@ -739,3 +739,19 @@ else
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#EOF
|
#EOF
|
||||||
|
|
||||||
|
token-extract-pubkey() {
|
||||||
|
case $1 in
|
||||||
|
--id|-d|--label|-a)
|
||||||
|
ssh-keygen -i -m pkcs8 -f <(pkcs11-tool --module $PKCS11_MODULE -r --type pubkey $1 $2 |openssl rsa -pubin -inform DER )
|
||||||
|
;;
|
||||||
|
--login|-l)
|
||||||
|
ssh-keygen -i -m pkcs8 -f <(pkcs11-tool --module $PKCS11_MODULE --login -r --type pubkey $1 $2 |openssl rsa -pubin -inform DER )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Please specify id or label as used in pkcs11-tool"
|
||||||
|
man pkcs11-tool
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue