Package com.sshtools.common.rsa
Class Rsa
java.lang.Object
com.sshtools.common.rsa.Rsa
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegerdoPrivate(BigInteger input, BigInteger modulus, BigInteger privateExponent) static BigIntegerdoPrivateCrt(BigInteger input, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger crtCoefficient) static BigIntegerdoPrivateCrt(BigInteger input, BigInteger p, BigInteger q, BigInteger dP, BigInteger dQ, BigInteger qInv) static BigIntegerdoPublic(BigInteger input, BigInteger modulus, BigInteger publicExponent) static Ssh2RsaPrivateCrtKeygenerateKey(int bits, BigInteger e, SecureRandom secRand) static Ssh2RsaPrivateCrtKeygenerateKey(int bits, SecureRandom secRand) static BigIntegergetPrimeExponent(BigInteger privateExponent, BigInteger prime) static BigIntegerpadPKCS1(BigInteger input, int type, int padLen) static BigIntegerremovePKCS1(BigInteger input, int type)
-
Constructor Details
-
Rsa
public Rsa()
-
-
Method Details
-
doPrivateCrt
public static BigInteger doPrivateCrt(BigInteger input, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger crtCoefficient) -
doPrivateCrt
public static BigInteger doPrivateCrt(BigInteger input, BigInteger p, BigInteger q, BigInteger dP, BigInteger dQ, BigInteger qInv) -
getPrimeExponent
-
padPKCS1
public static BigInteger padPKCS1(BigInteger input, int type, int padLen) throws IllegalStateException - Throws:
IllegalStateException
-
removePKCS1
- Throws:
IllegalStateException
-
generateKey
public static Ssh2RsaPrivateCrtKey generateKey(int bits, SecureRandom secRand) throws NoSuchAlgorithmException, InvalidKeySpecException -
generateKey
public static Ssh2RsaPrivateCrtKey generateKey(int bits, BigInteger e, SecureRandom secRand) throws NoSuchAlgorithmException, InvalidKeySpecException -
doPublic
-
doPrivate
public static BigInteger doPrivate(BigInteger input, BigInteger modulus, BigInteger privateExponent)
-