I think the reason might lie in the following code
private static X509Certificate2 GetCertificateFromDistinguishedName(string distinguishedName, X509Store certificateStore)
{
// Iterate through each certificate trying to find the first unexpired certificate
return certificateStore
.Certificates.Cast<X509Certificate2>()
.FirstOrDefault(certificate => string.Compare(
certificate.Subject,
distinguishedName,
StringComparison.CurrentCultureIgnoreCase) == 0);
}
that should rather compare distinguishedName parameter against certificate.SubjectName.Name instead of certificate.Subject. (At least for the sake of consistency with what Add and GetInfo TaskActions do.)
I think the reason might lie in the following code
that should rather compare
distinguishedName
parameter againstcertificate.SubjectName.Name
instead ofcertificate.Subject
. (At least for the sake of consistency with what Add and GetInfo TaskActions do.)