Commit Graph

6 Commits

Author SHA1 Message Date
Nathan McCauley 38fe6bd45b gofmt across the baord
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:24 -07:00
Nathan McCauley de6f65b7e7 many testing fixups to support key aliasing
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:22 -07:00
Aaron Lehmann e5a42d4df9 Add ExportKeysByGUN function
It exports the keys for a particular GUN to a zip, encrypted with a
specified passphrase.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:57 -07:00
Aaron Lehmann 0ffb2c69d9 Add a check that a root key being imported is encrypted
Add unit test coverage that makes this check fail. Also add unit test
coverage for making sure trying to import something that isn't PEM fails
in the expected way.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00
Aaron Lehmann 479333ca7b Add ExportRootKey and ImportRootKey functions
Also add a unit test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00
Aaron Lehmann eb8a7a0e25 Add ImportKeysZip and test coverage
This function reads a zip file and populates the keystores with the keys
in the zip file. Root keys are left encrypted, and non-root keys are
decrypted before being added to the keystore.

The unit test first exports a repo's keys to a zip file, then imports it
into another repo. It checks that all the correct keys exist in the new
repo after the import operation.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00