2011-09-29 103 views
1

在C#中,我可以通过使用如何通过CryptoAPI中的证书公钥获取密钥容器的信息?

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

回答

1

Here得到这个做,这是由穆尼尔IDRASSI编写的程序。这将为您提供您正在查找的信息。

也查找相关答案here