Example #1
0
 /// <summary>
 ///     Экспорт открытого ключа.
 /// </summary>
 /// <returns>Открытый ключ.</returns>
 public byte[] ExportPublicKey()
 {
     using (KeyContext keyContext = GetUserKey())
     {
         return(keyContext.ExportPublicKey());
     }
 }
Example #2
0
 public byte[] GetCertificatePublicKey(byte[] certificateData)
 {
     using (var facade = new GostCryptFacade(ProviderParams))
     {
         facade.AcquireContext(null, Constants.CryptVerifycontext);
         using (KeyContext keyContext = facade.ImportSertificate(certificateData))
         {
             return(keyContext.ExportPublicKey());
         }
     }
 }
Example #3
0
 /// <summary>
 /// Возвращает открытый ключ сертификата
 /// </summary>
 /// <param name="certificateData">данные сертификата</param>
 /// <returns></returns>
 public static byte[] GetCertificatePublicKey(byte[] certificateData)
 {
     using (var container = new KeyContainer())
     {
         container.AcquireContext(null, ProviderName, ProviderType, Constants.CryptVerifycontext);
         using (KeyContext keyContext = container.ImportSertificate(certificateData))
         {
             return(keyContext.ExportPublicKey());
         }
     }
 }