namespace com.hitrust.b2b.Security.Certificates
|
|
{
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct NameAttribute
|
|
{
|
|
public string ObjectID;
|
|
public string Value;
|
|
public NameAttribute(string oid, string val)
|
|
{
|
|
this.ObjectID = oid;
|
|
this.Value = val;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
try
|
|
{
|
|
NameAttribute attribute = (NameAttribute) obj;
|
|
return ((attribute.ObjectID == this.ObjectID) && (attribute.Value == this.Value));
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
if ((this.ObjectID == null) && (this.Value == null))
|
|
{
|
|
return 0;
|
|
}
|
|
if (this.ObjectID == null)
|
|
{
|
|
return this.Value.GetHashCode();
|
|
}
|
|
if (this.Value == null)
|
|
{
|
|
return this.ObjectID.GetHashCode();
|
|
}
|
|
return (this.Value.GetHashCode() ^ this.ObjectID.GetHashCode());
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
if ((this.ObjectID == null) && (this.Value == null))
|
|
{
|
|
return "N/A: N/A";
|
|
}
|
|
if (this.ObjectID == null)
|
|
{
|
|
return ("N/A: " + this.Value);
|
|
}
|
|
if (this.Value == null)
|
|
{
|
|
return (this.ObjectID + ": N/A");
|
|
}
|
|
return (this.ObjectID + ": " + this.Value);
|
|
}
|
|
}
|
|
}
|
|
|