examples
Class GenerateKeyPair
java.lang.Object
|
+--examples.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>
|
Method Summary |
static com.mindbright.jca.security.SecureRandom |
createSecureRandom()
|
static com.mindbright.jca.security.KeyPair |
generateKeyPair(java.lang.String alg,
int bits,
com.mindbright.jca.security.SecureRandom rand)
|
static void |
main(java.lang.String[] argv)
|
static void |
saveKeyPair(com.mindbright.jca.security.KeyPair kp,
java.lang.String passwd,
java.lang.String fileName,
java.lang.String subject,
java.lang.String comment,
boolean sshComFormat,
com.mindbright.jca.security.SecureRandom rand)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenerateKeyPair
public GenerateKeyPair()
generateKeyPair
public static com.mindbright.jca.security.KeyPair generateKeyPair(java.lang.String alg,
int bits,
com.mindbright.jca.security.SecureRandom rand)
throws com.mindbright.jca.security.NoSuchAlgorithmException
com.mindbright.jca.security.NoSuchAlgorithmException
saveKeyPair
public static void saveKeyPair(com.mindbright.jca.security.KeyPair kp,
java.lang.String passwd,
java.lang.String fileName,
java.lang.String subject,
java.lang.String comment,
boolean sshComFormat,
com.mindbright.jca.security.SecureRandom rand)
throws java.io.IOException,
SSH2Exception,
com.mindbright.jca.security.NoSuchAlgorithmException
java.io.IOException
SSH2Exception
com.mindbright.jca.security.NoSuchAlgorithmException
createSecureRandom
public static com.mindbright.jca.security.SecureRandom createSecureRandom()
main
public static void main(java.lang.String[] argv)