Exemplo n.º 1
0
        /// <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();
        }
Exemplo n.º 2
0
 /// <summary> Returns a CspBlob standard binary key definition </summary>
 public byte[] ToArray()
 {
     return(RSAKey.ExportCspBlob(IsPrivateKey));
 }