/** * @param <C> The generic client class * @param client The {@link SshClient} to updated * @param strict If {@code true} then files that do not have the required * access rights are excluded from consideration * @param supportedOnly If {@code true} then ignore identities that are not * supported internally * @param provider A {@link FilePasswordProvider} - may be {@code null} * if the loaded keys are <U>guaranteed</U> not to be encrypted. The argument * to {@link FilePasswordProvider#getPassword(String)} is the path of the * file whose key is to be loaded * @param options The {@link LinkOption}s to apply when checking * for existence * @return The updated <tt>client</tt> instance - provided a non-{@code null} * {@link KeyPairProvider} was generated * @throws IOException If failed to access the file system * @throws GeneralSecurityException If failed to load the keys * @see #setKeyPairProvider(SshClient, Path, boolean, boolean, FilePasswordProvider, LinkOption...) */ public static <C extends SshClient> C setKeyPairProvider( C client, boolean strict, boolean supportedOnly, FilePasswordProvider provider, LinkOption... options) throws IOException, GeneralSecurityException { return setKeyPairProvider(client, PublicKeyEntry.getDefaultKeysFolderPath(), strict, supportedOnly, provider, options); }
/** * @param <C> The generic client class * @param client The {@link SshClient} to updated * @param strict If {@code true} then files that do not have the required * access rights are excluded from consideration * @param supportedOnly If {@code true} then ignore identities that are not * supported internally * @param provider A {@link FilePasswordProvider} - may be {@code null} * if the loaded keys are <U>guaranteed</U> not to be encrypted. The argument * to {@code FilePasswordProvider#getPassword} is the path of the * file whose key is to be loaded * @param options The {@link LinkOption}s to apply when checking * for existence * @return The updated <tt>client</tt> instance - provided a non-{@code null} * {@link KeyPairProvider} was generated * @throws IOException If failed to access the file system * @throws GeneralSecurityException If failed to load the keys * @see #setKeyPairProvider(SshClient, Path, boolean, boolean, FilePasswordProvider, LinkOption...) */ public static <C extends SshClient> C setKeyPairProvider( C client, boolean strict, boolean supportedOnly, FilePasswordProvider provider, LinkOption... options) throws IOException, GeneralSecurityException { return setKeyPairProvider(client, PublicKeyEntry.getDefaultKeysFolderPath(), strict, supportedOnly, provider, options); }
ClientIdentity.loadDefaultKeyPairProvider(dir, strict, supportedOnly, provider, options); if (kpp != null) { client.setKeyPairProvider(kpp);
setKeyPairProvider(new DefaultClientIdentitiesWatcher(this::getClientIdentityLoader, this::getFilePasswordProvider));
public static SshClient setupTestClient(Class<?> anchor) { SshClient client = SshClient.setUpDefaultClient(); client.setServerKeyVerifier(AcceptAllServerKeyVerifier.INSTANCE); client.setHostConfigEntryResolver(HostConfigEntryResolver.EMPTY); client.setKeyPairProvider(KeyPairProvider.EMPTY_KEYPAIR_PROVIDER); return client; }
public static SshClient setupTestClient(Class<?> anchor) { SshClient client = SshClient.setUpDefaultClient(); client.setServerKeyVerifier(AcceptAllServerKeyVerifier.INSTANCE); client.setHostConfigEntryResolver(HostConfigEntryResolver.EMPTY); client.setKeyPairProvider(KeyPairProvider.EMPTY_KEYPAIR_PROVIDER); return client; }
public static SshClient setupTestClient(Class<?> anchor) { SshClient client = SshClient.setUpDefaultClient(); client.setServerKeyVerifier(AcceptAllServerKeyVerifier.INSTANCE); client.setHostConfigEntryResolver(HostConfigEntryResolver.EMPTY); client.setKeyPairProvider(KeyPairProvider.EMPTY_KEYPAIR_PROVIDER); return client; }
ServerKeyVerifier serverKeyVerifier = new ServerKeyVerifierImpl(knownHostsManager, quiet); client.setServerKeyVerifier(serverKeyVerifier); client.setKeyPairProvider(new FileKeyPairProvider()); log.debug("Created client: {}", client); client.setUserInteraction(new UserInteraction() {
client.setKeyPairProvider(new FileKeyPairProvider()); client.start(); ClientSession session = connectWithRetries(client, config);
ServerKeyVerifier serverKeyVerifier = new ServerKeyVerifierImpl(knownHostsManager, quiet); client.setServerKeyVerifier(serverKeyVerifier); client.setKeyPairProvider(new FileKeyPairProvider()); log.debug("Created client: {}", client); client.setUserInteraction(new UserInteraction() {
client.setKeyPairProvider(new FileKeyPairProvider()); client.start(); ClientSession session = connectWithRetries(client, config);
new JGitUserInteraction(credentialsProvider)); client.setUserAuthFactories(getUserAuthFactories()); client.setKeyPairProvider(defaultKeysProvider);