密钥库密码? ??

时间:2020-01-30 20:47:48

标签: macos google-cloud-platform command-line-interface gsutil

我正在尝试使用说明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密钥库吗?还有吗

任何有关正在引用哪个密钥库的线索,甚至我如何将密码更改为其他密码的线索,都应得到赞赏。

1 个答案:

答案 0 :(得分:2)

the signurl documentation的意思是:

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

[...]

gsutil signurl <private-key-file> gs://some-bucket/some-object/

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

因此,signurl之后的第一个参数(在您的问题中为my-private-key.json)是密钥库。它包含一个私钥。

通常,我们会对私钥进行加密,以便更难以窃取它们。因此,当您创建my-private-key.json时,可能会要求您输入密码,然后使用该密码来加密私钥。

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

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

相关问题