/// <summary> /// Writes a copy of this key into the local Csp store with the given options /// </summary> public void WriteToStore(string name, CspProviderFlags flags) { CspParameters cp = new CspParameters(); cp.KeyContainerName = name; cp.Flags = flags; RSACryptoServiceProvider csp = new RSACryptoServiceProvider(cp); csp.ImportCspBlob(RSAKey.ExportCspBlob(IsPrivateKey)); csp.PersistKeyInCsp = true; csp.Clear(); }
/// <summary> Returns a CspBlob standard binary key definition </summary> public byte[] ToArray() { return(RSAKey.ExportCspBlob(IsPrivateKey)); }