@Test public void testLoadPasswordNoKeystore() { final KeyStoreHelper serverHelper = new KeyStoreHelper(); try { serverHelper.getPasswordKey(null, null); fail(); } catch (final RuntimeException re) { assertTrue(true); } }
public String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword) { SecretKey passwordKey; try { passwordKey = (SecretKey) pwdKeyStore.getKey(pwdKeyAlias, pwdKeyPassword); } catch (Exception e) { throw new RuntimeException("Unable to load a key from Key Store. Source " + e.getCause()); } return new String(passwordKey.getEncoded()); }
KeyStoreHelper { public String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword) { SecretKey passwordKey; try { passwordKey = (SecretKey) pwdKeyStore.getKey(pwdKeyAlias, pwdKeyPassword); } catch (Exception e) { throw new RuntimeException("Unable to load a key from Key Store. Source " + e.getCause()); } return new String(passwordKey.getEncoded()); } }
KeyStoreHelper { public String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword) { SecretKey passwordKey; try { passwordKey = (SecretKey) pwdKeyStore.getKey(pwdKeyAlias, pwdKeyPassword); } catch (Exception e) { throw new RuntimeException("Unable to load a key from Key Store. Source " + e.getCause()); } return new String(passwordKey.getEncoded()); } KeyStoreHelper(); }
KeyStoreHelper { public String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword) { SecretKey passwordKey; try { passwordKey = (SecretKey) pwdKeyStore.getKey(pwdKeyAlias, pwdKeyPassword); } catch (Exception e) { throw new RuntimeException("Unable to load a key from Key Store. Source " + e.getCause()); } return new String(passwordKey.getEncoded()); } KeyStoreHelper(); byte[] signDataWithPrivateKey(byte[] data); boolean checkDataWithPublicKey(final String publicKeyAlias,
                                          final byte[] data,
                                          final byte[] signature); String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword); boolean isSigned(); URL getPvtKeyStoreURL(); char[] getPvtKeyStorePwd(); String getPvtKeyAlias(); char[] getPvtKeyPassword(); URL getPubKeyStoreURL(); char[] getPubKeyStorePwd(); KeyStore getPvtKeyStore(); KeyStore getPubKeyStore(); }
KeyStoreHelper { public String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword) { SecretKey passwordKey; try { passwordKey = (SecretKey) pwdKeyStore.getKey(pwdKeyAlias, pwdKeyPassword); } catch (Exception e) { throw new RuntimeException("Unable to load a key from Key Store. Source " + e.getCause()); } return new String(passwordKey.getEncoded()); } KeyStoreHelper(); byte[] signDataWithPrivateKey(byte[] data); boolean checkDataWithPublicKey(final String publicKeyAlias,
                                          final byte[] data,
                                          final byte[] signature); String getPasswordKey(String pwdKeyAlias, char[] pwdKeyPassword); boolean isSigned(); URL getPvtKeyStoreURL(); char[] getPvtKeyStorePwd(); String getPvtKeyAlias(); char[] getPvtKeyPassword(); URL getPubKeyStoreURL(); char[] getPubKeyStorePwd(); KeyStore getPvtKeyStore(); KeyStore getPubKeyStore();  }