com.maverick.ssh.components.jce
Class Ssh2RsaPublicKey

java.lang.Object
  extended by com.maverick.ssh.components.jce.Ssh2RsaPublicKey
All Implemented Interfaces:
SshPublicKey, SshRsaPublicKey
Direct Known Subclasses:
Ssh1RsaPublicKey, SshX509RsaPublicKey

public class Ssh2RsaPublicKey
extends Object
implements SshRsaPublicKey

A RSA public key implementation which uses a JCE provider.

Author:
Lee David Painter

Constructor Summary
Ssh2RsaPublicKey()
          Default constructor for initializing the key from a byte array using the init method.
Ssh2RsaPublicKey(BigInteger modulus, BigInteger publicExponent)
           
Ssh2RsaPublicKey(RSAPublicKey pubKey)
           
 
Method Summary
 BigInteger doPublic(BigInteger input)
           
 boolean equals(Object obj)
           
 String getAlgorithm()
           
 int getBitLength()
           
 byte[] getEncoded()
           
 String getFingerprint()
           
 BigInteger getModulus()
           
 BigInteger getPublicExponent()
           
 int getVersion()
           
 int hashCode()
           
 void init(byte[] blob, int start, int len)
           
 boolean verifySignature(byte[] signature, byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ssh2RsaPublicKey

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


Ssh2RsaPublicKey

public Ssh2RsaPublicKey(RSAPublicKey pubKey)

Ssh2RsaPublicKey

public Ssh2RsaPublicKey(BigInteger modulus,
                        BigInteger publicExponent)
                 throws NoSuchAlgorithmException,
                        InvalidKeySpecException
Throws:
NoSuchAlgorithmException
InvalidKeySpecException
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

getBitLength

public int getBitLength()
Specified by:
getBitLength in interface SshPublicKey

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)
                        throws SshException
Specified by:
verifySignature in interface SshPublicKey
Throws:
SshException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

doPublic

public BigInteger doPublic(BigInteger input)
                    throws SshException
Specified by:
doPublic in interface SshRsaPublicKey
Throws:
SshException

getModulus

public BigInteger getModulus()
Specified by:
getModulus in interface SshRsaPublicKey

getPublicExponent

public BigInteger getPublicExponent()
Specified by:
getPublicExponent in interface SshRsaPublicKey

getVersion

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


Copyright © 2012. All Rights Reserved.