如何在CryptoAPI中通过证书公钥获取密钥容器的信息

How to get information about key container through certificate public key in CryptoAPI?

本文关键字:密钥 获取 信息 公钥 证书 CryptoAPI      更新时间:2023-10-16

在c#中我可以使用

public static CspKeyContainerInfo GetKeyConatinerInformation(X509Certificate2 certificate)
{
   if (certificate == null)
      throw new ArgumentNullException("certificate");
   ICspAsymmetricAlgorithm key = certificate.PublicKey.Key as ICspAsymmetricAlgorithm;
      if (key == null)
         throw new InvalidOperationException("Unknown key type");
   return key.CspKeyContainerInfo;
}

我想知道如何通过使用c++和lib CryptoAPI来实现这一点

这是一个由Mounir IDRASSI编写的程序。这将为您提供您正在寻找的信息。