com.maverick.ssh2
Class Ssh2RsaPublicKey

java.lang.Object
  extended bycom.maverick.crypto.publickey.RsaKey
      extended bycom.maverick.crypto.publickey.RsaPublicKey
          extended bycom.maverick.ssh2.Ssh2RsaPublicKey
All Implemented Interfaces:
com.maverick.crypto.publickey.PublicKey, SshPublicKey

public class Ssh2RsaPublicKey
extends com.maverick.crypto.publickey.RsaPublicKey
implements SshPublicKey

Represents an SSH2 RSA Public key.

Author:
Lee David Painter

Field Summary
 
Fields inherited from class com.maverick.crypto.publickey.RsaPublicKey
ASN_SHA1, publicExponent
 
Fields inherited from class com.maverick.crypto.publickey.RsaKey
modulus
 
Constructor Summary
Ssh2RsaPublicKey()
          Default constructor for initializing the key from a byte array using the init method.
Ssh2RsaPublicKey(java.math.BigInteger modulus, java.math.BigInteger exponent)
          Construct an RSA key from parameters.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAlgorithm()
          Get the algorithm name for 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
 int hashCode()
           
 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.
 
Methods inherited from class com.maverick.crypto.publickey.RsaPublicKey
getPublicExponent, setPublicExponent
 
Methods inherited from class com.maverick.crypto.publickey.RsaKey
getBitLength, getModulus, setModulus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.maverick.ssh.SshPublicKey
getBitLength
 

Constructor Detail

Ssh2RsaPublicKey

public Ssh2RsaPublicKey()
Default constructor for initializing the key from a byte array using the init method.


Ssh2RsaPublicKey

public Ssh2RsaPublicKey(java.math.BigInteger modulus,
                        java.math.BigInteger exponent)
Construct an RSA key from parameters.

Parameters:
modulus -
exponent -
Method Detail

getEncoded

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

Specified by:
getEncoded in interface SshPublicKey
Returns:
an encoded byte array
Throws:
SshException

getFingerprint

public java.lang.String getFingerprint()
                                throws SshException
Description copied from interface: SshPublicKey
Return an SSH fingerprint of the public key

Specified by:
getFingerprint in interface SshPublicKey
Returns:
Throws:
SshException

init

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

Specified by:
init in interface SshPublicKey
Parameters:
blob -
start -
len -
Throws:
SshException

getAlgorithm

public java.lang.String getAlgorithm()
Description copied from interface: SshPublicKey
Get the algorithm name for the public key.

Specified by:
getAlgorithm in interface SshPublicKey
Returns:
the algorithm name, for example "ssh-dss"

verifySignature

public boolean verifySignature(byte[] signature,
                               byte[] data)
Description copied from interface: SshPublicKey
Verify the signature.

Specified by:
verifySignature in interface SshPublicKey

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()


Copyright © 2003 3SP LTD. All Rights Reserved.