public override int GetHashCode() { int hashCode = AlternateNameType.GetHashCode(); if (m_blob.Length > 4) { for (int i = 0; i < m_blob.Length; i += 4) { hashCode ^= BitConverter.ToInt32(m_blob, i); } } if (m_blob.Length > 0 && m_blob.Length % 4 != 0) { int remainder = 0; for (int i = 0; i < m_blob.Length % 4; ++i) { remainder |= (m_blob[m_blob.Length - i - 1]) << (8 * i); } hashCode ^= remainder; } return(hashCode); }
/// <summary> /// Create an alternate name for the given string /// </summary> /// <exception cref="ArgumentNullException">if <paramref name="name"/> is null</exception> public X509AlternateNameString(AlternateNameType type, string name) : base(type) { if (name == null) { throw new ArgumentNullException("name"); } m_name = name; }
/// <summary> /// Create an alternate name for the given IP address /// </summary> /// <exception cref="ArgumentNullException">if <paramref name="address"/> is null</exception> public X509AlternateNameIPAddress(AlternateNameType type, IPAddress address) : base(type) { if (address == null) { throw new ArgumentNullException("address"); } m_address = address; }
/// <summary> /// Create an alternate name for the given blob /// </summary> /// <exception cref="ArgumentNullException">if <paramref name="blob"/> is null</exception> public X509AlternateNameBlob(AlternateNameType type, byte[] blob) : base(type) { if (blob == null) throw new ArgumentNullException("blob"); m_blob = new byte[blob.Length]; Array.Copy(blob, m_blob, m_blob.Length); }
public override int GetHashCode() { return(AlternateNameType.GetHashCode()); }
/// <summary> /// Construct an empty X509AlternateName of the specified type /// </summary> public X509AlternateName(AlternateNameType type) { m_type = type; }
public override string ToString() { return(AlternateNameType.ToString()); }