Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }