Riyaz Faizullabhoy
5d0b926b7f
Use require for certs and trustmanager
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-04 14:44:48 -07:00
Riyaz Faizullabhoy
1ed9c352d7
change ks.AddKey to be consistent with CryptoService
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:31:06 -07:00
Riyaz Faizullabhoy
9ecd899e25
Removing key import and gun from cryptoservice
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:31:03 -07:00
Riyaz Faizullabhoy
7bd550a39a
import refactor
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:06:40 -07:00
Riyaz Faizullabhoy
c7bccd79e3
addressing review comments
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:06:39 -07:00
Riyaz Faizullabhoy
2a37590ea6
update interface and comments
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:06:37 -07:00
Riyaz Faizullabhoy
0f39dd7aa8
add GetKeyInfo test for memory store
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:04:04 -07:00
Riyaz Faizullabhoy
351b247aec
add tests for initial keystore state, and after removing and adding
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:03:11 -07:00
Riyaz Faizullabhoy
bbaef4faba
Flatten keystore by adding map, simple tests
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-18 11:00:50 -07:00
Riyaz Faizullabhoy
caa9581bcc
add tests, consts and fixup
...
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-02-08 13:38:42 -08:00
Ying Li
877d47bb5c
Add tests to ensure you can just drop a key in tuf_key and use it for signing.
...
This is important for user keys, which do not necessarily need to be under a GUN,
and may have a role other than one of the canonical roles (e.g. "user" role).
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-15 18:54:41 -08:00
David Lawrence
2bf5d4b09a
test for legacy keys and some bugfixes for same
...
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence
f2ec72b5b6
aliases removed from file names
...
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence
6d5b8ff54a
add role into PEM headers
...
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence
8628b57a96
private subdir should be added by keyfilestore, rather than all over the place
...
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:12:57 -08:00
Diogo Monica
baa92cefa3
Fixed panic on listKeys with invalid keys, added tests
...
Signed-off-by: David Lawrence <david.lawrence@docker.com>
Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
2015-11-12 01:11:27 -08:00
David Lawrence
be4c0669c1
move import/export to cryptoservice and add import to yubikey
...
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
Ying Li
aa5b621968
Fix import error after rebase
...
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:44:33 -07:00
Ying Li
75b63b84cd
Add import/export to KeyStore interface so that the import_export code
...
makes use of this rather than mangle files manually to import/export
root keys. (Regular keys it just zips up the whole directory.)
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-27 16:19:14 -07:00
Ying Li
566bd3ce67
Combine the nonRootKeyStore with the rootKeyStore, and move the abstracting
...
over the root keys directory from non-root keys directory from keystoremanager
to keystore, since we're eliminating keystoremanager.
Maintain the two separate directories, though, because one can't tell whether
there is an old-style separate-directories structure, or if someone has a GUN
that starts with tuf_keys.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-27 12:33:46 -07:00
Nathan McCauley
11af29d8db
update tests to check for new types
...
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-23 01:54:14 -07:00
Diogo Monica
f7ea67cfab
Rebased from master
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:46:01 -07:00
Diogo Monica
4dfe45d64e
Changing testify import
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:36:03 -07:00
Diogo Monica
42ded6231c
Converted tests to testify and EC generation
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:36:03 -07:00
Aaron Lehmann
1aced67471
Improvements to keystore caching
...
* RemoveKey must purge the cache entry
* Add mutexes to KeyFileStore and KeyMemoryStore so the cachedKeys map
is protected in the case that keystore operations happen from multiple
goroutines
* Change GetKey to return the alias along with the key. Remove
GetKeyAlias. This simplifies the code flows that retrieve the alias
(since they usually get the key and alias together).
* Fix tests affected by key caching
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-20 13:36:03 -07:00
Nathan McCauley
1421f47258
keystore caching
...
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 13:34:11 -07:00
Diogo Monica
f3a7fdf211
Removing doubling of string in test
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 11:42:10 -07:00
Nathan McCauley
f07876602f
add test for passphraseRetriever
...
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:24 -07:00
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
Diogo Mónica
2b7682c323
Merge pull request #82 from docker/new-unit-tests
...
New unit tests
2015-07-17 18:24:35 -07:00
Aaron Lehmann
f5d1a1fbf5
Add test coverage for KeyMemoryStore (and by extension, MemoryFileStore)
...
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-17 16:45:36 -07:00
Diogo Monica
3ec4f1d7f4
Adding RemoveKey and Test
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-17 14:31:43 -07:00
Diogo Monica
1ae9cf057e
Removing dangling temp test directories
2015-07-09 21:03:54 -07:00
Diogo Monica
4635bed2db
Major refactor of keys
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-09 17:58:10 -07:00
Diogo Monica
d5cdeb93bb
Adding EncryptedFileStore and changing interfaces
...
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-05 21:02:16 -07:00
Diogo Monica
fd8471038c
Added a keyfilestore with encrypted PEM support
2015-07-04 12:17:54 -07:00