这是wcf使用x509证书,通过custom方式验证的代码,为什么这两组字符串不一样,无论怎么转换都不行,我都拷贝出来一个字母一个字母对照了,也没发现有哪不一样
public class MyX509Validator : System.IdentityModel.Selectors.X509CertificateValidator { public override void Validate(X509Certificate2 certificate) { if (certificate == null) { throw new ArgumentNullException("X509认证证书为空!"); } //if (certificate.Thumbprint != "3a6b16f83cd397c6f21c945374a26a774caeb6ed".ToUpper()) if (certificate.Thumbprint.ToString() != "292B9E8705AC26DA4B2384A160B77D5052252F40") { //throw new System.IdentityModel.Tokens.SecurityTokenException("Certificate Validation Error!"); } } }
完整代码
292B9E8705AC26DA4B2384A160B77D5052252F40
292B9E8705AC26DA4B2384A160B77D5052252F40
问题解决,我也不知道怎么解决的,自己突然就相等了