com.maverick.ssh.components.jce
Class Ssh2RsaPrivateCrtKey

java.lang.Object
  extended by com.maverick.ssh.components.jce.Ssh2RsaPrivateCrtKey
All Implemented Interfaces:
SshPrivateKey, SshRsaPrivateCrtKey, SshRsaPrivateKey

public class Ssh2RsaPrivateCrtKey
extends Object
implements SshRsaPrivateCrtKey

RSA co-efficient private key implementation for SSH2 protocol.

Author:
Lee David Painter

Field Summary
protected  RSAPrivateCrtKey prv
           
 
Constructor Summary
Ssh2RsaPrivateCrtKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient)
           
Ssh2RsaPrivateCrtKey(RSAPrivateCrtKey prv)
           
 
Method Summary
 BigInteger doPrivate(BigInteger input)
           
 String getAlgorithm()
           
 BigInteger getCrtCoefficient()
           
 BigInteger getModulus()
           
 BigInteger getPrimeExponentP()
           
 BigInteger getPrimeExponentQ()
           
 BigInteger getPrimeP()
           
 BigInteger getPrimeQ()
           
 BigInteger getPrivateExponent()
           
 BigInteger getPublicExponent()
           
 byte[] sign(byte[] msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prv

protected RSAPrivateCrtKey prv
Constructor Detail

Ssh2RsaPrivateCrtKey

public Ssh2RsaPrivateCrtKey(RSAPrivateCrtKey prv)

Ssh2RsaPrivateCrtKey

public Ssh2RsaPrivateCrtKey(BigInteger modulus,
                            BigInteger publicExponent,
                            BigInteger privateExponent,
                            BigInteger primeP,
                            BigInteger primeQ,
                            BigInteger primeExponentP,
                            BigInteger primeExponentQ,
                            BigInteger crtCoefficient)
                     throws NoSuchAlgorithmException,
                            InvalidKeySpecException
Throws:
NoSuchAlgorithmException
InvalidKeySpecException
Method Detail

doPrivate

public BigInteger doPrivate(BigInteger input)
                     throws SshException
Specified by:
doPrivate in interface SshRsaPrivateCrtKey
Throws:
SshException

getCrtCoefficient

public BigInteger getCrtCoefficient()
Specified by:
getCrtCoefficient in interface SshRsaPrivateCrtKey

getPrimeExponentP

public BigInteger getPrimeExponentP()
Specified by:
getPrimeExponentP in interface SshRsaPrivateCrtKey

getPrimeExponentQ

public BigInteger getPrimeExponentQ()
Specified by:
getPrimeExponentQ in interface SshRsaPrivateCrtKey

getPrimeP

public BigInteger getPrimeP()
Specified by:
getPrimeP in interface SshRsaPrivateCrtKey

getPrimeQ

public BigInteger getPrimeQ()
Specified by:
getPrimeQ in interface SshRsaPrivateCrtKey

getPublicExponent

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

getModulus

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

getPrivateExponent

public BigInteger getPrivateExponent()
Specified by:
getPrivateExponent in interface SshRsaPrivateKey

sign

public byte[] sign(byte[] msg)
            throws IOException
Specified by:
sign in interface SshPrivateKey
Specified by:
sign in interface SshRsaPrivateKey
Throws:
IOException

getAlgorithm

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


Copyright © 2012. All Rights Reserved.