| | |
| | | import com.google.common.base.Charsets; |
| | | import com.google.common.base.Joiner; |
| | | import com.google.common.io.Files; |
| | | import com.google.inject.Inject; |
| | | |
| | | /** |
| | | * Manages public keys on the filesystem. |
| | |
| | | |
| | | protected final Map<File, Long> lastModifieds; |
| | | |
| | | @Inject |
| | | public FileKeyManager(IRuntimeManager runtimeManager) { |
| | | this.runtimeManager = runtimeManager; |
| | | this.lastModifieds = new ConcurrentHashMap<File, Long>(); |
| | |
| | | @Override |
| | | protected List<SshKey> getKeysImpl(String username) { |
| | | try { |
| | | log.info("loading keystore for {}", username); |
| | | log.info("loading ssh keystore for {}", username); |
| | | File keystore = getKeystore(username); |
| | | if (!keystore.exists()) { |
| | | return null; |
| | |
| | | return list; |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("Canot read ssh keys", e); |
| | | throw new RuntimeException("Cannot read ssh keys", e); |
| | | } |
| | | return null; |
| | | } |