이것은 C#에 도움이 될 수있는 방법입니다. C 코드에 익숙하지 않습니다. 얻고 인증서를 내보낼
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
private static X509Certificate GetClientCert()
{
X509Store store = null;
try
{
store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadOnly);
var certs = store.Certificates.Find(X509FindType.FindBySubjectName, "Integration Client Certificate", true);
if (certs.Count == 1)
{
var cert = certs[0];
return cert;
}
}
finally
{
if (store != null)
store.Close();
}
return null;
}
코드는 수출 방법은 내가 하나가 당신이 언급하는 형식이 될 것인지 확실하지 오전에 수출하기 위해 다양한 종류가
//This will bring up the selection prompt to select your cert
X509Certificate c = GetClientCert();
//The password should be the pin converted to a secure string variable.
//note the code above will not prompt for a pin if you want this you will have to build the prompt yourself. It will only select the certificate.
c.Export(X509ContentType.Cert, securestring password);
입니다. 이것은 당신이 가지고 놀 필요가있는 것입니다. C 언어로 라이브러리를 사용할 수 있을지 확신 할 수 없지만 게시 할 수 있기 때문에.
CAC 카드를 삽입하면 클라이언트 인증서가 자동으로 인증서 저장소에 복사됩니다. 궁극적으로 .pem 형식의 인증서가 필요합니다 (가능한 경우). – kmehta
Windows Credential Manager는 어떻습니까? – bahrep