com.sshtools.j2ssh.transport.publickey

Class SshtoolsPrivateKeyFormat

Implemented Interfaces:
SshKeyFormatConversion, SshPrivateKeyFormat

public class SshtoolsPrivateKeyFormat
extends Base64EncodedFileFormat
implements SshPrivateKeyFormat

Version:
$Revision: 1.22 $
Author:
$author$

Field Summary

Fields inherited from class com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat

begin, end

Constructor Summary

SshtoolsPrivateKeyFormat()
Creates a new SshtoolsPrivateKeyFormat object.
SshtoolsPrivateKeyFormat(String subject, String comment)
Creates a new SshtoolsPrivateKeyFormat object.

Method Summary

byte[]
decryptKeyblob(byte[] formattedKey, String passphrase)
byte[]
encryptKeyblob(byte[] keyblob, String passphrase)
String
getFormatType()
boolean
isPassphraseProtected(byte[] formattedKey)
boolean
supportsAlgorithm(String algorithm)

Methods inherited from class com.sshtools.j2ssh.transport.publickey.Base64EncodedFileFormat

formatKey, getFormatType, getHeaderValue, getKeyBlob, isFormatted, setHeaderValue

Constructor Details

SshtoolsPrivateKeyFormat

public SshtoolsPrivateKeyFormat()
Creates a new SshtoolsPrivateKeyFormat object.

SshtoolsPrivateKeyFormat

public SshtoolsPrivateKeyFormat(String subject,
                                String comment)
Creates a new SshtoolsPrivateKeyFormat object.
Parameters:
subject -
comment -

Method Details

decryptKeyblob

public byte[] decryptKeyblob(byte[] formattedKey,
                             String passphrase)
            throws InvalidSshKeyException
Specified by:
decryptKeyblob in interface SshPrivateKeyFormat
Parameters:
formattedKey -
passphrase -
Returns:

encryptKeyblob

public byte[] encryptKeyblob(byte[] keyblob,
                             String passphrase)
Specified by:
encryptKeyblob in interface SshPrivateKeyFormat
Parameters:
keyblob -
passphrase -
Returns:

getFormatType

public String getFormatType()
Specified by:
getFormatType in interface SshPrivateKeyFormat
getFormatType in interface SshKeyFormatConversion
Overrides:
getFormatType in interface Base64EncodedFileFormat
Returns:

isPassphraseProtected

public boolean isPassphraseProtected(byte[] formattedKey)
Specified by:
isPassphraseProtected in interface SshPrivateKeyFormat
Parameters:
formattedKey -
Returns:

supportsAlgorithm

public boolean supportsAlgorithm(String algorithm)
Specified by:
supportsAlgorithm in interface SshPrivateKeyFormat
Parameters:
algorithm -
Returns:

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