示例#1
0
  /**
   * @param in
   * @throws IOException
   */
  public RSASecretBCPGKey(BCPGInputStream in) throws IOException {
    this.d = new MPInteger(in);
    this.p = new MPInteger(in);
    this.q = new MPInteger(in);
    this.u = new MPInteger(in);

    expP = d.getValue().remainder(p.getValue().subtract(BigInteger.valueOf(1)));
    expQ = d.getValue().remainder(q.getValue().subtract(BigInteger.valueOf(1)));
    crt = q.getValue().modInverse(p.getValue());
  }
示例#2
0
 /** return the prime Q */
 public BigInteger getPrimeQ() {
   return q.getValue();
 }
示例#3
0
 /** return the prime P */
 public BigInteger getPrimeP() {
   return p.getValue();
 }
示例#4
0
 /**
  * return the private exponent for this key.
  *
  * @return BigInteger
  */
 public BigInteger getPrivateExponent() {
   return d.getValue();
 }
示例#5
0
 /**
  * return the modulus for this key.
  *
  * @return BigInteger
  */
 public BigInteger getModulus() {
   return p.getValue().multiply(q.getValue());
 }
示例#6
0
 public BigInteger getModulus() {
   return n.getValue();
 }
示例#7
0
 public BigInteger getPublicExponent() {
   return e.getValue();
 }