public String getPassword() { infer(); return password; }
public boolean hasPassword() { infer(); // blank, even empty passwords are allowed return password!=null; } /** if a password is available, and either this is preferred over a key or there is no key */
public String getPrivateKeyData() { infer(); return privateKeyData; } public String getPublicKeyData() {
public boolean hasKey() { infer(); // key has stricter non-blank check than password return Strings.isNonBlank(privateKeyData); } public boolean hasPassword() {
/** 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; }
/** throws if there were errors resolving (e.g. explicit keys, none of which were found/valid, or public key required and not found) * @return */ public OsCredential checkNoErrors() { throwOnErrors(true); dirty(); infer(); return this; }
public String getPublicKeyData() { infer(); return publicKeyData; } public String getPassword() {