/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Subject != null) { hashCode = hashCode * 59 + Subject.GetHashCode(); } if (Issuer != null) { hashCode = hashCode * 59 + Issuer.GetHashCode(); } if (NotBefore != null) { hashCode = hashCode * 59 + NotBefore.GetHashCode(); } if (NotAfter != null) { hashCode = hashCode * 59 + NotAfter.GetHashCode(); } if (SerialNumber != null) { hashCode = hashCode * 59 + SerialNumber.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Subject?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (IssuedBy?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ NotBefore.GetHashCode(); hashCode = (hashCode * 397) ^ NotAfter.GetHashCode(); hashCode = (hashCode * 397) ^ (Thumbprint?.GetHashCode() ?? 0); return(hashCode); } }