OpenShift Java Client 2.5.0.Final

com.openshift.client
Class SSHKeyPair

java.lang.Object
  extended by com.openshift.internal.client.ssh.AbstractSSHKey
      extended by com.openshift.client.SSHKeyPair
All Implemented Interfaces:
ISSHPublicKey

public class SSHKeyPair
extends AbstractSSHKey

Author:
André Dietisheim

Method Summary
static SSHKeyPair create(SSHKeyType type, String passPhrase, String privateKeyPath, String publicKeyPath)
          Creates private and public ssh-rsa keys and stores them to the given paths.
static SSHKeyPair create(String passPhrase, String privateKeyPath, String publicKeyPath)
           
 String getPrivateKeyPath()
           
 String getPublicKey()
          Returns the content of the public key (key content without ssh-rsa identifier nor comment) of the ssh key
 String getPublicKeyPath()
           
static SSHKeyPair load(String privateKeyPath, String publicKeyPath)
          Loads existing private and public ssh key from the given paths.
 
Methods inherited from class com.openshift.internal.client.ssh.AbstractSSHKey
equals, getKeyType, hashCode, setKeyType, setKeyType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

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 key
privateKeyPath - the path where the new private key gets stored
publicKeyPath - 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 key
publicKeyPath - 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()

OpenShift Java Client 2.5.0.Final

Copyright © 2014 JBoss, a division of Red Hat, Inc.. All Rights Reserved.