@@ -28,43 +28,41 @@ public KeePassXCAccess() {
2828 @ Override
2929 public boolean isLocked () { return proxy .getDatabasehash ().isEmpty (); }
3030
31- @ Override
32- public boolean needsAssociation () { return !proxy .connectionAvailable (); }
31+ private boolean needsAssociation () { return !proxy .connectionAvailable (); }
3332
34- @ Override
35- public boolean associate () { return proxy .associate (); }
33+ private boolean associate () { return proxy .associate (); }
3634
3735 public String unlock () { return proxy .getDatabasehash (true ); }
3836
3937 @ Override
4038 public void storePassphrase (String vault , CharSequence password ) throws KeychainAccessException {
4139 vault = URL_SCHEME + vault ;
4240 if (isLocked ()) {
43- throw new KeychainAccessException ("Storing of the passphrase failed " );
41+ throw new KeychainAccessException ("Failed to store password. KeePassXC database is locked. Needs to be unlocked first " );
4442 }
4543 if (!proxy .loginExists (vault , null , false , List .of (proxy .exportConnection ()), password .toString ())
4644 && !proxy .setLogin (vault , null , null , "Vault" , password .toString (), "default" , "default" , "default" )) {
47- throw new KeychainAccessException ("Storing of the passphrase failed" );
45+ throw new KeychainAccessException ("Storing of the password failed" );
4846 }
4947 }
5048
5149 @ Override
5250 public char [] loadPassphrase (String vault ) throws KeychainAccessException {
5351 if (isLocked ()) {
54- throw new KeychainAccessException ("Loading of the passphrase failed " );
52+ throw new KeychainAccessException ("Failed to load password. KeePassXC database is locked. Needs to be unlocked first " );
5553 }
5654 vault = URL_SCHEME + vault ;
5755 var answer = proxy .getLogins (vault , null , false , List .of (proxy .exportConnection ()));
5856 if (answer .isEmpty () || null == answer .get ("entries" )) {
59- throw new KeychainAccessException ("Loading of the passphrase failed" );
57+ throw new KeychainAccessException ("No password found for vault " + vault );
6058 }
6159 var array = (ArrayList <Object >) answer .get ("entries" );
6260 var credentials = (HashMap <String , Object >) array .get (0 );
6361 if (credentials .get ("password" ) != null ) {
6462 var password = (String ) credentials .get ("password" );
6563 return password .toCharArray ();
6664 } else {
67- throw new KeychainAccessException ("Loading of the passphrase failed" );
65+ throw new KeychainAccessException ("Loading of the password failed" );
6866 }
6967 }
7068
0 commit comments