examples
Class GenerateKeyPair

java.lang.Object
  extended byexamples.GenerateKeyPair

public class GenerateKeyPair
extends java.lang.Object

This is a simple demo of how to generate public key pairs for use with ssh2. A file containing some definitions of the key is supplied on the command line.

 usage: GenerateKeyPair <definition-file>
 


Constructor Summary
GenerateKeyPair()
           
 
Method Summary
static SecureRandom createSecureRandom()
           
static KeyPair generateKeyPair(java.lang.String alg, int bits, SecureRandom rand)
           
static void main(java.lang.String[] argv)
           
static void saveKeyPair(KeyPair kp, java.lang.String passwd, java.lang.String fileName, java.lang.String subject, java.lang.String comment, boolean sshComFormat, SecureRandom rand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateKeyPair

public GenerateKeyPair()
Method Detail

generateKeyPair

public static KeyPair generateKeyPair(java.lang.String alg,
                                      int bits,
                                      SecureRandom rand)
                               throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

saveKeyPair

public static void saveKeyPair(KeyPair kp,
                               java.lang.String passwd,
                               java.lang.String fileName,
                               java.lang.String subject,
                               java.lang.String comment,
                               boolean sshComFormat,
                               SecureRandom rand)
                        throws java.io.IOException,
                               SSH2Exception,
                               NoSuchAlgorithmException
Throws:
java.io.IOException
SSH2Exception
NoSuchAlgorithmException

createSecureRandom

public static SecureRandom createSecureRandom()

main

public static void main(java.lang.String[] argv)