예제 #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();
 }