org.apache.whirr.util
Class KeyPair

java.lang.Object
  extended by org.apache.whirr.util.KeyPair

public class KeyPair
extends Object

A convenience class for generating an RSA key pair.


Constructor Summary
KeyPair()
           
 
Method Summary
static Map<String,String> generate()
           
static Map<String,String> generate(String passPhrase)
          return a "public" -> rsa public key, "private" -> its corresponding private key
static Map<String,File> generateTemporaryFiles()
           
static Map<String,File> generateTemporaryFiles(String passPhrase)
           
static boolean sameKeyPair(File privateKeyFile, File publicKeyFile)
           
static void setPermissionsTo600(File f)
          Set file permissions to 600 (unix)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPair

public KeyPair()
Method Detail

generate

public static Map<String,String> generate()
                                   throws com.jcraft.jsch.JSchException
Throws:
com.jcraft.jsch.JSchException

generate

public static Map<String,String> generate(String passPhrase)
                                   throws com.jcraft.jsch.JSchException
return a "public" -> rsa public key, "private" -> its corresponding private key

Throws:
com.jcraft.jsch.JSchException

generateTemporaryFiles

public static Map<String,File> generateTemporaryFiles()
                                               throws com.jcraft.jsch.JSchException,
                                                      IOException
Throws:
com.jcraft.jsch.JSchException
IOException

generateTemporaryFiles

public static Map<String,File> generateTemporaryFiles(String passPhrase)
                                               throws com.jcraft.jsch.JSchException,
                                                      IOException
Throws:
com.jcraft.jsch.JSchException
IOException

setPermissionsTo600

public static void setPermissionsTo600(File f)
Set file permissions to 600 (unix)


sameKeyPair

public static boolean sameKeyPair(File privateKeyFile,
                                  File publicKeyFile)
                           throws IOException
Throws:
IOException


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.