All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.network.ssh.JschUtils Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.network.ssh;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.softicar.platform.common.core.properties.SystemPropertyEnum;

public class JschUtils {

	public static void addPublicKeyIdentity(JSch jsch) {

		try {
			jsch.addIdentity(getPublicKeyFilePath());
		} catch (JSchException exception) {
			throw new RuntimeException(exception);
		}
	}

	private static String getPublicKeyFilePath() {

		return String.format("%s/.ssh/id_rsa", SystemPropertyEnum.USER_HOME.get());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy