public void ImportParameters(RsaParameters ps) { if (ps.Module != null) { k = ps.Module.Length; if (ps.P != null) { p = new BigInteger(ps.P); } if (ps.Q != null) { q = new BigInteger(ps.Q); } if (ps.Module != null) { n = new BigInteger(ps.Module); } if (ps.Exponent != null) { e = new BigInteger(ps.Exponent); } if (ps.D != null) { d = new BigInteger(ps.D); } } }
public RsaParameters ExportParameters() { RsaParameters ps = new RsaParameters(); ps.P = p.ToByteArray(); ps.Q = q.ToByteArray(); ps.Module = n.ToByteArray(); ps.Exponent = e.ToByteArray(); ps.D = d.ToByteArray(); return(ps); }