public void writed()
{
try{
FileOutputStream fos = new FileOutputStream("c:\\key01.txt");
fos.write(d.toByteArray());
System.out.println("Done");
}catch(Exception e)
{
System.out.println("\nError in writed: " + e.getMessage());}
}
privateKey = (RSAPrivateCrtKey)keypair.getPrivate();
p = privateKey.getPrimeP();
q = privateKey.getPrimeQ();
phiN = p.subtract(BigInteger.ONE).multiply(q.subtract(BigInteger.ONE));
e = privateKey.getPublicExponent();
d = e.modInverse(phiN);
Any idea how to read the d from key01.txt? or better way to read and write the data from txt file?