org.apache.whirr.util
Class KeyPair
java.lang.Object
org.apache.whirr.util.KeyPair
public class KeyPair
- extends Object
A convenience class for generating an RSA key pair.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeyPair
public KeyPair()
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.