com.sshtools.j2ssh.transport.publickey
Class SshPrivateKeyFile

java.lang.Object
  extended by com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile

public class SshPrivateKeyFile
extends java.lang.Object

Version:
$Revision: 1.21 $
Author:
$author$

Constructor Summary
protected SshPrivateKeyFile(byte[] keyblob, SshPrivateKeyFormat format)
          Creates a new SshPrivateKeyFile object.
 
Method Summary
 void changePassphrase(java.lang.String oldPassphrase, java.lang.String newPassphrase)
           
static SshPrivateKeyFile create(SshPrivateKey key, java.lang.String passphrase, SshPrivateKeyFormat format)
           
 byte[] getBytes()
           
 SshPrivateKeyFormat getFormat()
           
 byte[] getKeyBlob(java.lang.String passphrase)
           
 boolean isPassphraseProtected()
           
static SshPrivateKeyFile parse(byte[] formattedKey)
           
static SshPrivateKeyFile parse(java.io.File keyfile)
           
 void setFormat(SshPrivateKeyFormat newFormat, java.lang.String passphrase)
           
 SshPrivateKey toPrivateKey(java.lang.String passphrase)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SshPrivateKeyFile

protected SshPrivateKeyFile(byte[] keyblob,
                            SshPrivateKeyFormat format)
Creates a new SshPrivateKeyFile object.

Parameters:
keyblob -
format -
Method Detail

getBytes

public byte[] getBytes()
Returns:

getKeyBlob

public byte[] getKeyBlob(java.lang.String passphrase)
                  throws InvalidSshKeyException
Parameters:
passphrase -
Returns:
Throws:
InvalidSshKeyException

changePassphrase

public void changePassphrase(java.lang.String oldPassphrase,
                             java.lang.String newPassphrase)
                      throws InvalidSshKeyException
Parameters:
oldPassphrase -
newPassphrase -
Throws:
InvalidSshKeyException

parse

public static SshPrivateKeyFile parse(byte[] formattedKey)
                               throws InvalidSshKeyException
Parameters:
formattedKey -
Returns:
Throws:
InvalidSshKeyException

parse

public static SshPrivateKeyFile parse(java.io.File keyfile)
                               throws InvalidSshKeyException,
                                      java.io.IOException
Parameters:
keyfile -
Returns:
Throws:
InvalidSshKeyException
java.io.IOException

isPassphraseProtected

public boolean isPassphraseProtected()
Returns:

create

public static SshPrivateKeyFile create(SshPrivateKey key,
                                       java.lang.String passphrase,
                                       SshPrivateKeyFormat format)
                                throws InvalidSshKeyException
Throws:
InvalidSshKeyException

setFormat

public void setFormat(SshPrivateKeyFormat newFormat,
                      java.lang.String passphrase)
               throws InvalidSshKeyException
Parameters:
newFormat -
passphrase -
Throws:
InvalidSshKeyException

getFormat

public SshPrivateKeyFormat getFormat()
Returns:

toPrivateKey

public SshPrivateKey toPrivateKey(java.lang.String passphrase)
                           throws InvalidSshKeyException
Parameters:
passphrase -
Returns:
Throws:
InvalidSshKeyException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:


Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.