com.maverick.ssh.components.standalone
Class Ssh2RsaPublicKey

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

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

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(BigInteger modulus, BigInteger exponent)
          Construct an RSA key from parameters.
 
Method Summary
 BigInteger doPublic(BigInteger input)
           
 boolean equals(Object obj)
           
 String getAlgorithm()
           
 byte[] getEncoded()
           
 String getFingerprint()
           
 int getVersion()
           
 int hashCode()
           
 void init(byte[] blob, int start, int len)
           
 boolean verifySignature(byte[] signature, byte[] data)
           
 
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.components.SshRsaPublicKey
getModulus, getPublicExponent
 
Methods inherited from interface com.maverick.ssh.components.SshPublicKey
getBitLength
 

Constructor Detail

Ssh2RsaPublicKey

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


Ssh2RsaPublicKey

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

Parameters:
modulus -
exponent -
Method Detail

getEncoded

public byte[] getEncoded()
                  throws SshException
Specified by:
getEncoded in interface SshPublicKey
Throws:
SshException

getFingerprint

public String getFingerprint()
                      throws SshException
Specified by:
getFingerprint in interface SshPublicKey
Throws:
SshException

init

public void init(byte[] blob,
                 int start,
                 int len)
          throws SshException
Specified by:
init in interface SshPublicKey
Throws:
SshException

getAlgorithm

public String getAlgorithm()
Specified by:
getAlgorithm in interface SshPublicKey

verifySignature

public boolean verifySignature(byte[] signature,
                               byte[] data)
Specified by:
verifySignature in interface SshPublicKey
Overrides:
verifySignature in class com.maverick.crypto.publickey.RsaPublicKey

equals

public boolean equals(Object obj)
Overrides:
equals in class 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 BigInteger doPublic(BigInteger input)
Specified by:
doPublic in interface SshRsaPublicKey


Copyright © 2012. All Rights Reserved.