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>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenerateKeyPair
public GenerateKeyPair()
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)