package at.gv.egovernment.moa.spss.api.impl;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams;
import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo;
import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest;

/**
 * Default implementation of <code>VerifyXMLSignatureRequest</code>.
 * 
 * @author Fatemeh Philippi
 * @version $Id$
 */
public class VerifyXMLSignatureRequestImpl
  implements VerifyXMLSignatureRequest {
  /** Date and time for signature verification. */
  private Date dateTime;
  /** The signature to be verified. */
  private VerifySignatureInfo verifySignatureInfo;
  /** Supplemental information about the singature. */
  private List supplementProfiles;
  /** Additional parameters for checking the signature manifest. */
  private SignatureManifestCheckParams signatureManifestCheckParams;
  /** Whether to return the hash input data. */
  private boolean returnHashInputData;
  /** The profile ID of the trust profile containing the trusted certificates. 
   */
  private String trustProfileId;

  /**
   * Sets the date and time for signature verification.
   * 
   * @param dateTime The date and time for signature verification.
   */
  public void setDateTime(Date dateTime) {
    this.dateTime = dateTime;
  }

  public Date getDateTime() {
    return dateTime;
  }

  /** 
   * Sets the signature to be verified.
   * 
   * @param signatureInfo The signature to be verified.
   */
  public void setSignatureInfo(VerifySignatureInfo signatureInfo) {
    this.verifySignatureInfo = signatureInfo;
  }

  public VerifySignatureInfo getSignatureInfo() {
    return verifySignatureInfo;
  }

  /**
   * Sets supplemental information about the singature.
   * @param supplementProfiles
   */
  public void setSupplementProfiles(List supplementProfiles) {
    this.supplementProfiles =
      supplementProfiles != null
        ? Collections.unmodifiableList(new ArrayList(supplementProfiles))
        : null;
  }

  public List getSupplementProfiles() {
    return supplementProfiles;
  }

  /**
   * Sets supplemental information about the singature.
   * @param params Supplemental information about the singature.
   */
  public void setSignatureManifestCheckParams(SignatureManifestCheckParams params) {
    this.signatureManifestCheckParams = params;
  }

  public SignatureManifestCheckParams getSignatureManifestCheckParams() {
    return signatureManifestCheckParams;
  }

  /**
   * Sets whether to return hash input data.
   * 
   * @param returnSignedData Whether to return hash input data.
   */
  public void setReturnHashInputData(boolean returnSignedData) {
    this.returnHashInputData = returnSignedData;
  }

  public boolean getReturnHashInputData() {
    return returnHashInputData;
  }

  /**
   * Sets the profile ID of trusted certificates.
   * 
   * @param trustProfileId The profile ID of trusted certificates.
   */
  public void setTrustProfileId(String trustProfileId) {
    this.trustProfileId = trustProfileId;
  }

  public String getTrustProfileId() {
    return trustProfileId;
  }

}