// be sure to maintain PHP version of this too!
function DkimSspPolicyKey(domain)
{
  this.domain = domain;
  this.policy = 'unknown';
  this.flags = new Array();

  this.setPolicy = function (policy)
  {
    this.policy = policy;
  }

  this.addFlag = function (flag)
  {
    this.flags[this.flags.length] = flag;
  }

  this.getPolicyKey = function ()
  {
    var retval = 'dkim=' + this.policy;

    if (this.flags.length > 0)
    {
      retval += '; t=' + this.flags.join(':');
    }

    return retval;
  }

  this.getDomainZoneEntry = function ()
  {
    return '_adsp._domainkey.' + this.domain + "\tIN\tTXT\t\"" + this.getPolicyKey() + "\"";
  }
}

