@Test public void testIsKeyPairInitialized() throws Exception { assertThat("Expected false after creating a new (empty) KeyStoreManager", !keyStoreManager.isKeyPairInitialized()); keyStoreManager.generateAndStoreKeyPair("Joe Coder", "dev", "codeSoft", "AnyTown", "state", "US"); assertThat("Expected true after creating a new KeyPair", keyStoreManager.isKeyPairInitialized()); assertThat("Expected true after loading an existing KeystoreManager", createKeyStoreManager(storageManager).isKeyPairInitialized()); }
@Override public boolean isKeyPairInitialized() { privateKeyStoreLock.readLock().lock(); try { return isKeyPairInstalled(privateKeyStore, PRIVATE_KEY_ALIAS); } finally { privateKeyStoreLock.readLock().unlock(); } }
KeyStoreManagerImpl extends ComponentSupport implements KeyStoreManager { @Override public boolean isKeyPairInitialized() { privateKeyStoreLock.readLock().lock(); try { return isKeyPairInstalled(privateKeyStore, PRIVATE_KEY_ALIAS); } finally { privateKeyStoreLock.readLock().unlock(); } } }
KeyStoreManagerImpl extends ComponentSupport implements KeyStoreManager { @Override public boolean isKeyPairInitialized() { privateKeyStoreLock.readLock().lock(); try { return isKeyPairInstalled(privateKeyStore, PRIVATE_KEY_ALIAS); } finally { privateKeyStoreLock.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); }
KeyStoreManagerImpl extends ComponentSupport implements KeyStoreManager { @Override public boolean isKeyPairInitialized() { privateKeyStoreLock.readLock().lock(); try { return isKeyPairInstalled(privateKeyStore, PRIVATE_KEY_ALIAS); } finally { privateKeyStoreLock.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(); }
KeyStoreManagerImpl extends ComponentSupport implements KeyStoreManager { @Override public boolean isKeyPairInitialized() { privateKeyStoreLock.readLock().lock(); try { return isKeyPairInstalled(privateKeyStore, PRIVATE_KEY_ALIAS); } finally { privateKeyStoreLock.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();  }