You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docker trust key load does not load key into ~/.docker/trust/private #1095
Tried running docker key trust load and it does not load the key into ~/.docker/trust/private despite
it saying the key is successfully imported, it merely creates trust/private directory but the key file is not present in /private directory
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:20:16 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:23:58 2018
OS/Arch: linux/amd64
Experimental: false
changed the title [-]Docker trust key load does not load key into ~/.docker/trust/[/-][+]Docker trust key load does not load key into ~/.docker/trust/private[/+]on May 31, 2018
Bit weird, but seems like the code expects your key to have the "path" header set. Figured this out by looking in Notary's documentation. Was able to import a key formatted like:
It still fails even with Docker Client 19.03.12.
The docker trust key import operation ends successfully even if no key is really imported.
On the other hand, notary key import fails with an ambiguous error: key may be encrypted and does not contain path header and fatal: failed to import all keys: invalid key pem block.
Apparently, both docker trust key generate and notary key generate create keys which are not able to import afterwards.
The solution, not documented anywhere, except in the comment above (#1095 (comment)), is to edit the key and add the path field with the key id.
Example:
and the key will be imported correctly in the private folder with name as the path specified plus .key (in this case would be: hex_key_id_without_dot_key.key
Ana alternative and better approach is to export the key with notary as explained here: #2031
Activity
[-]Docker trust key load does not load key into ~/.docker/trust/[/-][+]Docker trust key load does not load key into ~/.docker/trust/private[/+]krockpot commentedon Sep 22, 2018
Bit weird, but seems like the code expects your key to have the "path" header set. Figured this out by looking in Notary's documentation. Was able to import a key formatted like:
Relevant doc: https://godoc.org/github.com/docker/notary/trustmanager#ImportKeys
Also fyi, if you generate the key with notary, the
notary key exportcommand will generate a key in this format for you.krufab commentedon Oct 12, 2020
It still fails even with Docker Client 19.03.12.
The
docker trust key importoperation ends successfully even if no key is really imported.On the other hand, notary key import fails with an ambiguous error:
key may be encrypted and does not contain path headerandfatal: failed to import all keys: invalid key pem block.Apparently, both
docker trust key generateandnotary key generatecreate keys which are not able to import afterwards.The solution, not documented anywhere, except in the comment above (#1095 (comment)), is to edit the key and add the path field with the key id.
Example:
and the key will be imported correctly in the private folder with name as the path specified plus
.key(in this case would be:hex_key_id_without_dot_key.keyAna alternative and better approach is to export the key with notary as explained here: #2031
thaJeztah commentedon May 14, 2026
docker trustfrom the CLI; remove support for client-side docker content trust validation #6603