RSAPrivateKeyImpl(BigInteger n,BigInteger d) throws InvalidKeyException {
  this.n=n;
  this.d=d;
  RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(),null);
  algid=RSAPrivateCrtKeyImpl.rsaId;
  try {
    DerOutputStream out=new DerOutputStream();
    out.putInteger(0);
    out.putInteger(n);
    out.putInteger(0);
    out.putInteger(d);
    out.putInteger(0);
    out.putInteger(0);
    out.putInteger(0);
    out.putInteger(0);
    out.putInteger(0);
    DerValue val=new DerValue(DerValue.tag_Sequence,out.toByteArray());
    key=val.toByteArray();
  }
 catch (  IOException exc) {
    throw new InvalidKeyException(exc);
  }
}

RSAPrivateKeyImpl ( BigInteger n , BigInteger d ) throws InvalidKeyException { this . n = n ; this . d = d ; RSAKeyFactory . checkRSAProviderKeyLengths ( n . bitLength ( ) , null ) ; algid = RSAPrivateCrtKeyImpl . rsaId ; try { DerOutputStream out = new DerOutputStream ( ) ; out . putInteger ( 0 ) ; out . putInteger ( n ) ; out . putInteger ( 0 ) ; out . putInteger ( d ) ; out . putInteger ( 0 ) ; out . putInteger ( 0 ) ; out . putInteger ( 0 ) ; out . putInteger ( 0 ) ; out . putInteger ( 0 ) ; DerValue val = new DerValue ( DerValue . tag_Sequence , out . toByteArray ( ) ) ; key = val . toByteArray ( ) ; } catch ( IOException exc ) { throw new InvalidKeyException ( exc ) ; } }
construct a key from its components . used by the rsakeyfactory and the rsakeypairgenerator .
