com.maverick.ssh.components
Interface SshPublicKey

All Known Subinterfaces:
SshDsaPublicKey, SshRsaPublicKey
All Known Implementing Classes:
Ssh1RsaPublicKey, Ssh1RsaPublicKey, Ssh2DsaPublicKey, Ssh2DsaPublicKey, Ssh2RsaPublicKey, Ssh2RsaPublicKey, SshX509DsaPublicKey, SshX509RsaPublicKey, SshX509RsaSha1PublicKey

public interface SshPublicKey

Interface for SSH supported public keys.

Author:
Lee David Painter

Method Summary
 java.lang.String getAlgorithm()
          Get the algorithm name for the public key.
 int getBitLength()
          Get the bit length of the public key
 byte[] getEncoded()
          Encode the public key into a blob of binary data, the encoded result will be passed into init to recreate the key.
 java.lang.String getFingerprint()
          Return an SSH fingerprint of the public key
 void init(byte[] blob, int start, int len)
          Initialize the public key from a blob of binary data.
 boolean verifySignature(byte[] signature, byte[] data)
          Verify the signature.
 

Method Detail

init

void init(byte[] blob,
          int start,
          int len)
          throws SshException
Initialize the public key from a blob of binary data.

Parameters:
blob -
start -
len -
Throws:
SshException

getAlgorithm

java.lang.String getAlgorithm()
Get the algorithm name for the public key.

Returns:
the algorithm name, for example "ssh-dss"

getBitLength

int getBitLength()
Get the bit length of the public key

Returns:
the bit length of the public key

getEncoded

byte[] getEncoded()
                  throws SshException
Encode the public key into a blob of binary data, the encoded result will be passed into init to recreate the key.

Returns:
an encoded byte array
Throws:
SshException

getFingerprint

java.lang.String getFingerprint()
                                throws SshException
Return an SSH fingerprint of the public key

Returns:
String
Throws:
SshException

verifySignature

boolean verifySignature(byte[] signature,
                        byte[] data)
                        throws SshException
Verify the signature.

Parameters:
signature -
data -
Returns:
true if the signature was produced by the corresponding private key that owns this public key, otherwise false.
Throws:
SshException


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.