/** if both key and password supplied, prefer the key; the default */ public OsCredential preferKey() { preferPassword = false; return dirty(); } /** if both key and password supplied, prefer the password; see {@link #preferKey()} */
/** if both key and password supplied, prefer the password; see {@link #preferKey()} */ public OsCredential preferPassword() { preferPassword = true; return dirty(); }
/** whether to check the private/public keys and passphrase are coherent; default true */ public OsCredential doKeyValidation(boolean doKeyValidation) { this.doKeyValidation = doKeyValidation; return dirty(); } /** if true (the default) this will look at default locations set on keys */
/** if false, do not mind if there is no public key corresponding to any private key; * defaults to true; only applies if a private key is set */ public OsCredential requirePublicKey(boolean requirePublicKey) { this.requirePublicKey = requirePublicKey; return dirty(); } /** whether to check the private/public keys and passphrase are coherent; default true */
/** 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; }
/** whether to throw on problems */ public OsCredential throwOnErrors(boolean throwOnErrors) { this.throwOnErrors = throwOnErrors; return dirty(); }
/** if true (the default) this will look at default locations set on keys */ public OsCredential useDefaultKeys(boolean tryDefaultKeys) { this.tryDefaultKeys = tryDefaultKeys; return dirty(); } /** whether to log warnings on problems */
/** whether to log warnings on problems */ public OsCredential warnOnErrors(boolean warnOnErrors) { this.warnOnErrors = warnOnErrors; return dirty(); } /** whether to throw on problems */