add support for sets in types
abstract out common shape of CorruptKeyFileError