KeyStoreManagerImpl extends ComponentSupport implements KeyStoreManager { @Override public Certificate getTrustedCertificate(String alias) throws KeystoreException { trustedKeyStoreLock.readLock().lock(); try { return trustedKeyStore.getCertificate( checkNotNull(alias, "'alias' cannot be null when looking up a trusted Certificate."), config.getTrustedKeyStorePassword()); } finally { trustedKeyStoreLock.readLock().unlock(); } } KeyStoreManagerImpl(final CryptoHelper crypto,
                             final KeyStoreStorageManager storageManager,
                             final KeyStoreManagerConfiguration config); @VisibleForTesting  KeyStoreManagerImpl(final CryptoHelper crypto,
                      final KeyStoreManagerConfiguration config,
                      final KeystoreInstance privateKeyStore,
                      final KeystoreInstance trustedKeyStore); @Override TrustManager[] getTrustManagers(); @Override KeyManager[] getKeyManagers(); @Override void importTrustCertificate(Certificate certificate, String alias); @Override void importTrustCertificate(String certificateInPEM, String alias); @Override Certificate getTrustedCertificate(String alias); @Override Collection<Certificate> getTrustedCertificates(); @Override void removeTrustCertificate(String alias); @Override void generateAndStoreKeyPair(final String commonName,
                                      final String organizationalUnit,
                                      final String organization,
                                      final String locality,
                                      final String state,
                                      final String country); @Override boolean isKeyPairInitialized(); @Override Certificate getCertificate(); @Override PrivateKey getPrivateKey(); @Override void removePrivateKey();  }
@Test(expected = KeyNotFoundException.class) public void testGetTrustedCertificateEmptyAlias() throws Exception { keyStoreManager.getTrustedCertificate(""); }
@Test(expected = KeyNotFoundException.class) public void testGetTrustedCertificateBlankAlias() throws Exception { keyStoreManager.getTrustedCertificate(" "); }