com.sshtools.j2ssh.transport.publickey
Interface SshPublicKey

All Known Implementing Classes:
SshDss

public interface SshPublicKey

Defines a public key mechanism for use within the SSH API

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )

Method Summary
 java.lang.String getFingerprint()
          Implement this method to return the keys fingerprint
 java.lang.String getFormattedKey()
          Implement this to return a formatted key string
 void init(byte[] hostkey)
          Called by the framework to initialize the key
 boolean verifySignature(byte[] signature, byte[] exchangeHash)
          Implement this method to verify the signature
 

Method Detail

init

public void init(byte[] hostkey)
          throws InvalidHostKeyException
Called by the framework to initialize the key

Parameters:
hostkey - The host key data
Throws:
InvalidHostKeyException - Throw if the host key data is invalid

getFormattedKey

public java.lang.String getFormattedKey()
Implement this to return a formatted key string

Returns:
The formatted key

getFingerprint

public java.lang.String getFingerprint()
Implement this method to return the keys fingerprint

Returns:
The fingerprint value

verifySignature

public boolean verifySignature(byte[] signature,
                               byte[] exchangeHash)
                        throws InvalidHostKeySignatureException
Implement this method to verify the signature

Parameters:
signature - The signature to verify
exchangeHash - The exchange hash output of key exchange
Returns:
The success of the verification
Throws:
InvalidHostKeySignatureException - Throw if the signature is in an invalid format (not for a verification failure)


Copyright © 2002 Sshtools.com. All Rights Reserved.