通常,可以通过以下代码来访问保存在 Windows 系统提供的密钥容器中的  RSA  密钥:  
               //  Create  the  CspParameters  object  and  set  the  key  container    
               //  name  used  to  store  the  RSA  key  pair.  
               CspParameters  cp  =  new  CspParameters();  
               cp.KeyContainerName  =  "MyKeyContainerName";  
 
               //  Create  a  new  instance  of  RSACryptoServiceProvider  that    
               //  accesses the  key  container  MyKeyContainerName.  
               RSACryptoServiceProvider  rsa  =  new  RSACryptoServiceProvider(cp);  
 
以上代码中,如果在  Windows  系统中指定的命名密钥容器不存在,则会自动创建相应的密钥容器,同时将新  RSA  实例的密钥值储存到新创建的容器中。如果指定命名容器存在的话,则会自动取出容器中的  RSA  密钥,并创建相应的  RSACryptoServiceProvider。  
 
但上述代码不能将一个已有的  RSA  密钥保存到指定命名的密钥容器中。我原来以为  Windows  系统不允许从外部保存密钥进容器,只能使用由系统自动生成的  RSA  密钥。  
然而,.NET  强名称实用工具程序  SN.exe  却提供了将  RSA  密钥随意地存入密钥容器的命令项参数:  
             sn  /i  <infile>  <container>  
对应的导出操作为:  
             sn  /pc  <container>  <outfile>  
 
现在,我想用代码来自行实现  SN.exe  所提供的密钥保存到容器的功能,在此请教各位大侠。