- java.lang.Object
-
- java.security.spec.RSAPrivateKeySpec
-
- java.security.spec.RSAMultiPrimePrivateCrtKeySpec
-
- All Implemented Interfaces:
-
KeySpec
public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec
该类指定PKCS#1 v2.1中定义的RSA多权限私钥,使用中文余数定理(CRT)信息值进行效率。- 从以下版本开始:
- 1.4
- 另请参见:
-
Key,KeyFactory,KeySpec,PKCS8EncodedKeySpec,RSAPrivateKeySpec,RSAPublicKeySpec,RSAOtherPrimeInfo
-
-
构造方法摘要
构造方法 Constructor 描述 RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, RSAOtherPrimeInfo[] otherPrimeInfo)根据PKCS#1 v2.1中定义的模数,publicExponent,privateExponent,primeP,primeQ,primeExponentP,primeExponentQ,crtCoefficient和otherPrimeInfo,创建一个新的RSAMultiPrimePrivateCrtKeySpec。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 BigIntegergetCrtCoefficient()返回crtCoefficient。RSAOtherPrimeInfo[]getOtherPrimeInfo()如果只有两个素因子(p和q),则返回otherPrimeInfo的副本或null。BigIntegergetPrimeExponentP()返回primeExponentP。BigIntegergetPrimeExponentQ()返回primeExponentQ。BigIntegergetPrimeP()返回primeP。BigIntegergetPrimeQ()返回primeQ。BigIntegergetPublicExponent()返回公共指数。-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class java.security.spec.RSAPrivateKeySpec
getModulus, getPrivateExponent
-
-
-
-
构造方法详细信息
-
RSAMultiPrimePrivateCrtKeySpec
public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, RSAOtherPrimeInfo[] otherPrimeInfo)
创建一个新的RSAMultiPrimePrivateCrtKeySpec给定在PKCS#1 v2.1中定义的模数,publicExponent,privateExponent,primeP,primeQ,primeExponentP,primeExponentQ,crtCoefficient和otherPrimeInfo。请注意,复制
otherPrimeInfo的内容以防止在构建此对象时进行后续修改。- 参数
-
modulus- 模数n。 -
publicExponent- 公众指数e。 -
privateExponent- 私有指数d。 -
primeP- n的素因子p。 -
primeQ- n的素因子q。 -
primeExponentP- 这是d mod(p-1)。 -
primeExponentQ- 这是d mod(q-1)。 -
crtCoefficient- 中国剩余定理系数q-1 mod p。 -
otherPrimeInfo- 如果只有两个素因子(p和q),则可以指定其余素数的三元组。 - 异常
-
NullPointerException-如果任何一个参数,即modulus,publicExponent,privateExponent,primeP,primeQ,primeExponentP,primeExponentQ,crtCoefficient,为空。 -
IllegalArgumentException- 如果指定一个空的,即0长度,otherPrimeInfo。
-
-
方法详细信息
-
getPublicExponent
public BigInteger getPublicExponent()
返回公共指数。- 结果
- 公众指数。
-
getPrimeP
public BigInteger getPrimeP()
返回primeP。- 结果
- 黄金。
-
getPrimeQ
public BigInteger getPrimeQ()
返回primeQ。- 结果
- 最好的。
-
getPrimeExponentP
public BigInteger getPrimeExponentP()
返回primeExponentP。- 结果
- primeExponentP。
-
getPrimeExponentQ
public BigInteger getPrimeExponentQ()
返回primeExponentQ。- 结果
- primeExponentQ。
-
getCrtCoefficient
public BigInteger getCrtCoefficient()
返回crtCoefficient。- 结果
- crt系数。
-
getOtherPrimeInfo
public RSAOtherPrimeInfo[] getOtherPrimeInfo()
如果只有两个素因子(p和q),则返回otherPrimeInfo的副本或null。- 结果
- otherPrimeInfo。 每次调用此方法时都会返回一个新数组。
-
-