com.sshtools.j2ssh.transport.publickey

Class SshPrivateKeyFile


public class SshPrivateKeyFile
extends java.lang.Object

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

Constructor Summary

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

Method Summary

void
changePassphrase(String oldPassphrase, String newPassphrase)
static SshPrivateKeyFile
create(SshPrivateKey key, String passphrase, SshPrivateKeyFormat format)
byte[]
getBytes()
SshPrivateKeyFormat
getFormat()
byte[]
getKeyBlob(String passphrase)
boolean
isPassphraseProtected()
static SshPrivateKeyFile
parse(File keyfile)
static SshPrivateKeyFile
parse(byte[] formattedKey)
void
setFormat(SshPrivateKeyFormat newFormat, String passphrase)
SshPrivateKey
toPrivateKey(String passphrase)
String
toString()

Constructor Details

SshPrivateKeyFile

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

Method Details

changePassphrase

public void changePassphrase(String oldPassphrase,
                             String newPassphrase)
            throws InvalidSshKeyException
Parameters:
oldPassphrase -
newPassphrase -

create

public static SshPrivateKeyFile create(SshPrivateKey key,
                                       String passphrase,
                                       SshPrivateKeyFormat format)
            throws InvalidSshKeyException

getBytes

public byte[] getBytes()
Returns:

getFormat

public SshPrivateKeyFormat getFormat()
Returns:

getKeyBlob

public byte[] getKeyBlob(String passphrase)
            throws InvalidSshKeyException
Parameters:
passphrase -
Returns:

isPassphraseProtected

public boolean isPassphraseProtected()
Returns:

parse

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

parse

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

setFormat

public void setFormat(SshPrivateKeyFormat newFormat,
                      String passphrase)
            throws InvalidSshKeyException
Parameters:
newFormat -
passphrase -

toPrivateKey

public SshPrivateKey toPrivateKey(String passphrase)
            throws InvalidSshKeyException
Parameters:
passphrase -
Returns:

toString

public String toString()
Returns:

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