/** returns either the key or password or null; if both a key and a password this prefers the key unless otherwise set * via {@link #preferPassword()} */ public synchronized String getPreferredCredential() { infer(); if (isUsingPassword()) return password; if (hasKey()) return privateKeyData; return null; }