private byte[] getEncryptedPassword(IPreferencesContainer container) { ISecurePreferences node = container.getPreferences().node(WIN_PROVIDER_NODE); String passwordHint; try { passwordHint = node.get(PASSWORD_KEY, null); } catch (StorageException e) { // should never happen in this scenario AuthPlugin.getDefault().logError(WinCryptoMessages.decryptPasswordFailed, e); return null; } if (passwordHint == null) return null; return Base64.decode(passwordHint); }
/** * Provides decoding of Base64-encoded string * * @param string data encoded as Base64 * @return decoded data */ public static byte[] decodeBase64(String string) { return Base64.decode(string); }