@Test public void testGetPassword() throws Exception { LegacyPrivateKeyPasswordProvider pkpp = new LegacyPrivateKeyPasswordProvider(); assertEquals(getPassword(), new String(pkpp.retrievePrivateKeyPassword())); assertEquals(getPassword(), new String(pkpp.retrievePrivateKeyPassword())); }
@Override public char[] retrievePrivateKeyPassword() throws PasswordException { if (pkPassword == null) { try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(PKEY_PW_FILE)) { Properties p = new Properties(); p.load(is); pkPassword = Password.decode(p.getProperty(PKEY_PW_KEY)).toCharArray(); } catch (IOException e) { throw new PasswordException(e); } } return pkPassword; }
LegacyPrivateKeyPasswordProvider implements PrivateKeyPasswordProvider { @Override public char[] retrievePrivateKeyPassword() throws PasswordException { if (pkPassword == null) { try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(PKEY_PW_FILE)) { Properties p = new Properties(); p.load(is); pkPassword = Password.decode(p.getProperty(PKEY_PW_KEY)).toCharArray(); } catch (IOException e) { throw new PasswordException(e); } } return pkPassword; } }
LegacyPrivateKeyPasswordProvider implements PrivateKeyPasswordProvider { @Override public char[] retrievePrivateKeyPassword() throws PasswordException { if (pkPassword == null) { try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(PKEY_PW_FILE)) { Properties p = new Properties(); p.load(is); pkPassword = Password.decode(p.getProperty(PKEY_PW_KEY)).toCharArray(); } catch (IOException e) { throw new PasswordException(e); } } return pkPassword; } LegacyPrivateKeyPasswordProvider(); }
LegacyPrivateKeyPasswordProvider implements PrivateKeyPasswordProvider { @Override public char[] retrievePrivateKeyPassword() throws PasswordException { if (pkPassword == null) { try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(PKEY_PW_FILE)) { Properties p = new Properties(); p.load(is); pkPassword = Password.decode(p.getProperty(PKEY_PW_KEY)).toCharArray(); } catch (IOException e) { throw new PasswordException(e); } } return pkPassword; } LegacyPrivateKeyPasswordProvider(); @Override char[] retrievePrivateKeyPassword(); }
LegacyPrivateKeyPasswordProvider implements PrivateKeyPasswordProvider { @Override public char[] retrievePrivateKeyPassword() throws PasswordException { if (pkPassword == null) { try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(PKEY_PW_FILE)) { Properties p = new Properties(); p.load(is); pkPassword = Password.decode(p.getProperty(PKEY_PW_KEY)).toCharArray(); } catch (IOException e) { throw new PasswordException(e); } } return pkPassword; } LegacyPrivateKeyPasswordProvider(); @Override char[] retrievePrivateKeyPassword();  }