gpt4 book ai didi

ssh - do_convert_from_pkcs8 :/dev/fd/63 is not a recognised public key format

转载 作者:行者123 更新时间:2023-12-02 14:30:01 26 4
gpt4 key购买 nike

我正在尝试使用以下脚本检索我的 PIV key :
getPIVkey.sh

NAME=`security find-certificate | grep PIV | sed 's;keychain:";;g' | sed 's;";;g'`
echo $NAME
ssh-keygen -i -m pkcs8 -f <(security find-certificate -p "$NAME" | openssl x509 -noout -pubkey)

在 Mac OS High Sierra 10.13.4 上。我得到:
./getPIVPub.sh
keychain: PIV-Bill K Brown (piv)
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
unable to load certificate
140735828857800:error:0906D06C:PEM routines:PEM_read_bio:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.50.2/libressl/crypto/pem/pem_lib.c:704:Expecting: TRUSTED CERTIFICATE
do_convert_from_pkcs8: /dev/fd/63 is not a recognised public key format

最佳答案

您的第一个 sed 中似乎缺少一个空格命令,在 keychain: 之间和报价。所以你的命令设置NAME变量应该是

NAME=`security find-certificate | grep PIV | sed 's;keychain: ";;g' | sed 's;";;g'`

随着改进的 sed命令, NAME 的(打印的)值不应再以 keychain: 开头但只包含名称。

由于 NAME 中的值错误,第二个 security find-certificate命令失败,因此输出 The specified output could not be found in the keychain. .之后执行的命令也会失败。

仅供引用,引用 /dev/fd/63 的原因在问题 Why does process substitution result in a file called /dev/fd/63 which is a pipe? 的答案中进行了解释

关于ssh - do_convert_from_pkcs8 :/dev/fd/63 is not a recognised public key format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51470544/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com