com.maverick.ssh.components.standalone
Class Ssh1RsaPublicKey

java.lang.Object
  extended by com.maverick.crypto.publickey.RsaKey
      extended by com.maverick.crypto.publickey.RsaPublicKey
          extended by com.maverick.ssh.components.standalone.Ssh1RsaPublicKey
All Implemented Interfaces:
com.maverick.crypto.publickey.PublicKey, SshPublicKey, SshRsaPublicKey

public class Ssh1RsaPublicKey
extends com.maverick.crypto.publickey.RsaPublicKey
implements SshRsaPublicKey

This class represents an SSH1 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
Ssh1RsaPublicKey(java.math.BigInteger modulus, java.math.BigInteger publicExponent)
          Construct the RSA public key.
 
Method Summary
 java.math.BigInteger doPublic(java.math.BigInteger input)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAlgorithm()
          The algorithm name "rsa1"
 byte[] getEncoded()
          Get the encoded format required by SSH1
 java.lang.String getFingerprint()
          Return an SSH fingerprint of the public key
 int getVersion()
           
 int hashCode()
           
 void init(byte[] blob, int offset, int len)
          Initiate the key from an encoded byte array.
 
Methods inherited from class com.maverick.crypto.publickey.RsaPublicKey
getPublicExponent, setPublicExponent, verifySignature
 
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.components.SshRsaPublicKey
getModulus, getPublicExponent
 
Methods inherited from interface com.maverick.ssh.components.SshPublicKey
getBitLength, verifySignature
 

Constructor Detail

Ssh1RsaPublicKey

public Ssh1RsaPublicKey(java.math.BigInteger modulus,
                        java.math.BigInteger publicExponent)
Construct the RSA public key.

Parameters:
modulus -
publicExponent -
Method Detail

getEncoded

public byte[] getEncoded()
                  throws SshException
Get the encoded format required by SSH1

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

init

public void init(byte[] blob,
                 int offset,
                 int len)
Initiate the key from an encoded byte array. This implementation does nothing because we do not provide a default constructor

Specified by:
init in interface SshPublicKey

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:
String
Throws:
SshException

getAlgorithm

public java.lang.String getAlgorithm()
The algorithm name "rsa1"

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class com.maverick.crypto.publickey.RsaPublicKey

getVersion

public int getVersion()
Specified by:
getVersion in interface SshRsaPublicKey

doPublic

public java.math.BigInteger doPublic(java.math.BigInteger input)
Specified by:
doPublic in interface SshRsaPublicKey


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