/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace be.portugal.eid {

using System;
using System.Runtime.InteropServices;

public class PTEID_Certificate : PTEID_Crypto {
  private HandleRef swigCPtr;

  internal PTEID_Certificate(IntPtr cPtr, bool cMemoryOwn) : base(pteidlib_dotNetPINVOKE.PTEID_CertificateUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(PTEID_Certificate obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~PTEID_Certificate() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        pteidlib_dotNetPINVOKE.delete_PTEID_Certificate(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public string getLabel() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getLabel(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint getID() {
    uint ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getID(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifStatus getStatus() {
    PTEID_CertifStatus ret = (PTEID_CertifStatus)pteidlib_dotNetPINVOKE.PTEID_Certificate_getStatus__SWIG_0(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifStatus getStatus(PTEID_ValidationLevel crl, PTEID_ValidationLevel ocsp) {
    PTEID_CertifStatus ret = (PTEID_CertifStatus)pteidlib_dotNetPINVOKE.PTEID_Certificate_getStatus__SWIG_1(swigCPtr, (int)crl, (int)ocsp);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifType getType() {
    PTEID_CertifType ret = (PTEID_CertifType)pteidlib_dotNetPINVOKE.PTEID_Certificate_getType(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getCertData() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_Certificate_getCertData(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void getFormattedData(PTEID_ByteArray data) {
    pteidlib_dotNetPINVOKE.PTEID_Certificate_getFormattedData(swigCPtr, PTEID_ByteArray.getCPtr(data));
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public string getSerialNumber() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getSerialNumber(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getOwnerName() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getOwnerName(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getIssuerName() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getIssuerName(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getValidityBegin() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getValidityBegin(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getValidityEnd() {
    string ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getValidityEnd(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint getKeyLength() {
    uint ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_getKeyLength(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isRoot() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_isRoot(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isTest() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_isTest(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isFromPteidValidChain() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_isFromPteidValidChain(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isFromCard() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_isFromCard(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getIssuer() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificate_getIssuer(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint countChildren() {
    uint ret = pteidlib_dotNetPINVOKE.PTEID_Certificate_countChildren(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getChildren(uint ulIndex) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificate_getChildren(swigCPtr, ulIndex), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Crl getCRL() {
    PTEID_Crl ret = new PTEID_Crl(pteidlib_dotNetPINVOKE.PTEID_Certificate_getCRL(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_OcspResponse getOcspResponse() {
    PTEID_OcspResponse ret = new PTEID_OcspResponse(pteidlib_dotNetPINVOKE.PTEID_Certificate_getOcspResponse(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifStatus verifyCRL(bool forceDownload) {
    PTEID_CertifStatus ret = (PTEID_CertifStatus)pteidlib_dotNetPINVOKE.PTEID_Certificate_verifyCRL__SWIG_0(swigCPtr, forceDownload);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifStatus verifyCRL() {
    PTEID_CertifStatus ret = (PTEID_CertifStatus)pteidlib_dotNetPINVOKE.PTEID_Certificate_verifyCRL__SWIG_1(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CertifStatus verifyOCSP() {
    PTEID_CertifStatus ret = (PTEID_CertifStatus)pteidlib_dotNetPINVOKE.PTEID_Certificate_verifyOCSP(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
