Keystore密码?嗯?

问题描述 投票:1回答:1

我正在尝试使用说明here创建GCP签名URL。当我运行gsutil命令创建我的签名URL时,系统立即提示我输入“密钥库密码”。所以这个:

gsutil signurl -d 10m my-private-key.json gs://my-storage-bucket/index.html

结果:

Keystore password: [I enter a wrong password]
Encountered an error while refreshing access token. If you are using a service account,
please verify that the gs_service_key_file field in your config file(s), /Users/my-user/.boto, /Users/my-user/.config/gcloud/legacy_credentials/my-gcp-user-email/.boto, is correct.

坦率地说,我丝毫不知道我的密钥库密码是什么,甚至还不是它在说什么密钥库。它是本地Mac密钥库吗?它是GCP密钥库吗?还有吗

关于被引用哪个密钥库的任何线索,甚至我可能将密码更改为其他密码的线索都可以理解。

macos google-cloud-platform command-line-interface gsutil
1个回答
2
投票

the signurl documentation的意思是:

signurl

[...]

gsutil signurl [-c <content_type>] [-d <duration>] [-m <http_method>] \
   [-p <password>] [-r <region>] keystore-file url...

signurl命令将私钥用于服务帐户(''参数)以生成加密签名用于生成的URL。私钥文件必须位于PKCS12或JSON中格式。如果私钥已加密,则签名的url命令将提示输入用于保护私钥文件的密码(默认为“ notasecret”)。有关生成广告的更多信息与signurl命令一起使用的私钥,请参阅身份验证文档。

因此,gsutil signurl <private-key-file> gs://some-bucket/some-object/ 之后的第一个参数(在您的问题中为signurl是密钥库)。它包含一个私钥。

通常,我们会加密私钥,以便更难以窃取。因此,当您创建my-private-key.json时,可能会要求您输入密码短语,并且该密码短语用于加密私钥。

但是my-private-key.json需要先解密私钥,然后才能使用私钥对您的URL进行签名。因此,gsutil需要用于加密私钥的密码。您需要在gsutil提示符下输入该密码。如果您忘记了用于创建私钥的密码,则需要创建一个新的私钥。

(也许密码短语实际上是“ notasecret”?)

© www.soinside.com 2019 - 2024. All rights reserved.