You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
Is it possible to use X509Identity as IUserIdentity to open ClientSessionChannel?
I want to use .pfx certificate to authentificate user. Is it possible to do?
Constructor X509Identity(X509Certificate certificate, RsaKeyParameters privateKey) has privateKey parameter. I don't have privateKey.
The text was updated successfully, but these errors were encountered:
You can also try code like this to load the .pfx file
// try load pfx. pfx files can have password
{
var x509Identity = default(X509Identity);
var crtPassword = "password";
var userCertInfo = new FileInfo(Path.Combine(pkiPath, "user", "certs", "ctt_usrT.pfx"));
if (userCertInfo.Exists)
{
using (var crtStream = userCertInfo.OpenRead())
{
var store = new Pkcs12StoreBuilder().Build();
store.Load(crtStream, crtPassword?.ToCharArray() ?? Array.Empty<char>());
var alias = store.Aliases.First();
var cert = store.GetCertificate(alias);
var key = store.GetKey(alias);
x509Identity = new X509Identity(cert.Certificate, key.Key as RsaKeyParameters);
}
}
}
Hello.
Is it possible to use X509Identity as IUserIdentity to open ClientSessionChannel?
I want to use .pfx certificate to authentificate user. Is it possible to do?
Constructor X509Identity(X509Certificate certificate, RsaKeyParameters privateKey) has privateKey parameter. I don't have privateKey.
The text was updated successfully, but these errors were encountered: