protected static void LoadPrivate(RsaKeyPair keys, string filePath) { if (!File.Exists(filePath)) { throw new InvalidOperationException("The specified filePath was not found"); } keys.PrivateKeyXml = File.ReadAllText(filePath); }
public static RsaKeyPair Load(string directory, string fileName) { RsaKeyPair result = new RsaKeyPair(); string pubFile = Path.Combine(directory, string.Format("{0}.pub", fileName)); LoadPublic(result, pubFile); string privFile = Path.Combine(directory, string.Format("{0}.priv", fileName)); LoadPrivate(result, privFile); return(result); }