com.openshift.client
Class SSHKeyPair
java.lang.Object
com.openshift.internal.client.ssh.AbstractSSHKey
com.openshift.client.SSHKeyPair
- All Implemented Interfaces:
- ISSHPublicKey
public class SSHKeyPair
- extends AbstractSSHKey
- Author:
- André Dietisheim
create
public static SSHKeyPair create(String passPhrase,
String privateKeyPath,
String publicKeyPath)
throws OpenShiftException
- Throws:
OpenShiftException
create
public static SSHKeyPair create(SSHKeyType type,
String passPhrase,
String privateKeyPath,
String publicKeyPath)
throws OpenShiftException
- Creates private and public ssh-rsa keys and stores them to the given
paths. The key is created while using the given pass phrase.
- Parameters:
passPhrase
- the pass phrase to set to the new keyprivateKeyPath
- the path where the new private key gets storedpublicKeyPath
- the path where the new public key gets stored
- Returns:
-
- Throws:
OpenShiftException
- if the key could not be created
load
public static SSHKeyPair load(String privateKeyPath,
String publicKeyPath)
throws OpenShiftException
- Loads existing private and public ssh key from the given paths.
- Parameters:
privateKeyPath
- the path to the private keypublicKeyPath
- the path to the public key
- Returns:
-
- Throws:
OpenShiftException
getPublicKey
public String getPublicKey()
- Description copied from interface:
ISSHPublicKey
- Returns the content of the public key (key content without ssh-rsa
identifier nor comment) of the ssh key
- Returns:
- the content of the public key (without signature, without
comment)
getPrivateKeyPath
public String getPrivateKeyPath()
getPublicKeyPath
public String getPublicKeyPath()
Copyright © 2014 JBoss, a division of Red Hat, Inc.. All Rights Reserved.